/*
 * VentasDiaView.java
 */
package ventasdia;

import com.util.Fecha;
import com.util.UtilidadesFecha;
import com.util.database.UtilidadesBaseDatos;
import com.util.files.Ficheros;
import java.io.File;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jdesktop.application.Action;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import ventasdia.modelo.ArticuloVO;
import ventasdia.modelo.ClienteVO;
import ventasdia.modelo.PedidoVO;

/**
 * The application's main frame.
 */
public class VentasDiaView extends FrameView {

    public VentasDiaView(SingleFrameApplication app) {
        super(app);
       
        if (!Ficheros.existeFicheroConfiguracion()) {
            showConfiguracion();
            // TODO Meter un método habilitar deshabilitar
        } else {
            recargar_Configuracion();
            crear_estructura_directorios();
        }
    }

    //****************Ventanas***********************************************************
    @Action
    public void showConfiguracion() {
        if (configuracion == null) {
            JFrame mainFrame = VentasDiaApp.getApplication().getMainFrame();
            configuracion = new Configuracion(mainFrame);
            configuracion.setLocationRelativeTo(mainFrame);
        }
        VentasDiaApp.getApplication().show(configuracion);
    }

    @Action
    public void showEfectivo() {
        if (efectivoDialog == null) {
            JFrame mainFrame = VentasDiaApp.getApplication().getMainFrame();
            efectivoDialog = new EfectivoDialog(mainFrame);
            efectivoDialog.setLocationRelativeTo(mainFrame);
        }
        VentasDiaApp.getApplication().show(efectivoDialog);
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = VentasDiaApp.getApplication().getMainFrame();
            aboutBox = new VentasDiaAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        VentasDiaApp.getApplication().show(aboutBox);
    }

    @Action
    public void showActualizaciones() {
        JFrame mainFrame = VentasDiaApp.getApplication().getMainFrame();
        actualizacionDialog = new ActualizacionPrecios(mainFrame);
        actualizacionDialog.setLocationRelativeTo(mainFrame);
        VentasDiaApp.getApplication().show(actualizacionDialog);
    }

    //-----------------------------------------------------------------------------------------
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel50 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel156 = new javax.swing.JLabel();
        jLabel157 = new javax.swing.JLabel();
        jLabel158 = new javax.swing.JLabel();
        jLabel159 = new javax.swing.JLabel();
        jLabel160 = new javax.swing.JLabel();
        jLabel161 = new javax.swing.JLabel();
        jLabel162 = new javax.swing.JLabel();
        jLabel163 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        jLabel55 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jLabel59 = new javax.swing.JLabel();
        jLabel60 = new javax.swing.JLabel();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        jLabel64 = new javax.swing.JLabel();
        jLabel65 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel164 = new javax.swing.JLabel();
        jLabel165 = new javax.swing.JLabel();
        jLabel166 = new javax.swing.JLabel();
        jLabel167 = new javax.swing.JLabel();
        jLabel168 = new javax.swing.JLabel();
        jLabel169 = new javax.swing.JLabel();
        jLabel170 = new javax.swing.JLabel();
        jLabel171 = new javax.swing.JLabel();
        jLabel172 = new javax.swing.JLabel();
        jLabel173 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        jLabel61 = new javax.swing.JLabel();
        jLabel66 = new javax.swing.JLabel();
        jLabel67 = new javax.swing.JLabel();
        jLabel68 = new javax.swing.JLabel();
        jLabel69 = new javax.swing.JLabel();
        jLabel70 = new javax.swing.JLabel();
        jLabel71 = new javax.swing.JLabel();
        jLabel72 = new javax.swing.JLabel();
        jLabel73 = new javax.swing.JLabel();
        jLabel74 = new javax.swing.JLabel();
        jLabel75 = new javax.swing.JLabel();
        jLabel76 = new javax.swing.JLabel();
        jLabel77 = new javax.swing.JLabel();
        jLabel78 = new javax.swing.JLabel();
        jLabel79 = new javax.swing.JLabel();
        jLabel80 = new javax.swing.JLabel();
        jLabel81 = new javax.swing.JLabel();
        jLabel117 = new javax.swing.JLabel();
        jLabel118 = new javax.swing.JLabel();
        jLabel119 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jLabel175 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabel176 = new javax.swing.JLabel();
        jComboBox2 = new javax.swing.JComboBox();
        jLabel177 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jButton4 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel178 = new javax.swing.JLabel();
        jLabel179 = new javax.swing.JLabel();
        jLabel180 = new javax.swing.JLabel();
        jLabel181 = new javax.swing.JLabel();
        jLabel182 = new javax.swing.JLabel();
        jLabel183 = new javax.swing.JLabel();
        jLabel184 = new javax.swing.JLabel();
        jLabel185 = new javax.swing.JLabel();
        jLabel186 = new javax.swing.JLabel();
        jLabel187 = new javax.swing.JLabel();
        jLabel188 = new javax.swing.JLabel();
        jLabel189 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel83 = new javax.swing.JLabel();
        jLabel84 = new javax.swing.JLabel();
        jLabel85 = new javax.swing.JLabel();
        jLabel86 = new javax.swing.JLabel();
        jLabel87 = new javax.swing.JLabel();
        jLabel88 = new javax.swing.JLabel();
        jLabel89 = new javax.swing.JLabel();
        jLabel90 = new javax.swing.JLabel();
        jLabel91 = new javax.swing.JLabel();
        jLabel92 = new javax.swing.JLabel();
        jLabel93 = new javax.swing.JLabel();
        jLabel94 = new javax.swing.JLabel();
        jLabel95 = new javax.swing.JLabel();
        jLabel96 = new javax.swing.JLabel();
        jLabel97 = new javax.swing.JLabel();
        jLabel98 = new javax.swing.JLabel();
        jLabel99 = new javax.swing.JLabel();
        jLabel100 = new javax.swing.JLabel();
        jLabel101 = new javax.swing.JLabel();
        jLabel102 = new javax.swing.JLabel();
        jLabel103 = new javax.swing.JLabel();
        jLabel104 = new javax.swing.JLabel();
        jLabel105 = new javax.swing.JLabel();
        jLabel106 = new javax.swing.JLabel();
        jLabel107 = new javax.swing.JLabel();
        jLabel108 = new javax.swing.JLabel();
        jLabel109 = new javax.swing.JLabel();
        jLabel110 = new javax.swing.JLabel();
        jLabel111 = new javax.swing.JLabel();
        jLabel112 = new javax.swing.JLabel();
        jLabel113 = new javax.swing.JLabel();
        jLabel114 = new javax.swing.JLabel();
        jLabel115 = new javax.swing.JLabel();
        jLabel116 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jLabel148 = new javax.swing.JLabel();
        jLabel149 = new javax.swing.JLabel();
        jLabel150 = new javax.swing.JLabel();
        jLabel151 = new javax.swing.JLabel();
        jLabel152 = new javax.swing.JLabel();
        jLabel153 = new javax.swing.JLabel();
        jLabel120 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel121 = new javax.swing.JLabel();
        jLabel122 = new javax.swing.JLabel();
        jLabel123 = new javax.swing.JLabel();
        jLabel124 = new javax.swing.JLabel();
        jLabel125 = new javax.swing.JLabel();
        jLabel126 = new javax.swing.JLabel();
        jLabel127 = new javax.swing.JLabel();
        jLabel128 = new javax.swing.JLabel();
        jLabel129 = new javax.swing.JLabel();
        jLabel130 = new javax.swing.JLabel();
        jLabel131 = new javax.swing.JLabel();
        jLabel132 = new javax.swing.JLabel();
        jLabel133 = new javax.swing.JLabel();
        jLabel134 = new javax.swing.JLabel();
        jLabel135 = new javax.swing.JLabel();
        jLabel136 = new javax.swing.JLabel();
        jLabel137 = new javax.swing.JLabel();
        jLabel138 = new javax.swing.JLabel();
        jLabel139 = new javax.swing.JLabel();
        jLabel140 = new javax.swing.JLabel();
        jLabel141 = new javax.swing.JLabel();
        jLabel142 = new javax.swing.JLabel();
        jLabel143 = new javax.swing.JLabel();
        jLabel144 = new javax.swing.JLabel();
        jLabel145 = new javax.swing.JLabel();
        jLabel146 = new javax.swing.JLabel();
        jLabel147 = new javax.swing.JLabel();
        jCalendar1 = new com.toedter.calendar.JCalendar();
        jCalendar2 = new com.toedter.calendar.JCalendar();
        jLabel82 = new javax.swing.JLabel();
        jLabel154 = new javax.swing.JLabel();
        jLabel155 = new javax.swing.JLabel();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jProgressBar1 = new javax.swing.JProgressBar();
        jLabel174 = new javax.swing.JLabel();
        jSlider1 = new javax.swing.JSlider();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();

        mainPanel.setMaximumSize(new java.awt.Dimension(607, 340));
        mainPanel.setName("mainPanel"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(ventasdia.VentasDiaApp.class).getContext().getActionMap(VentasDiaView.class, this);
        jButton1.setAction(actionMap.get("calcular")); // NOI18N
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(ventasdia.VentasDiaApp.class).getContext().getResourceMap(VentasDiaView.class);
        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N

        jButton2.setAction(actionMap.get("act_poner_fecha_hoy")); // NOI18N
        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N

        jButton3.setAction(actionMap.get("imprimir_ticket")); // NOI18N
        jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
        jButton3.setName("jButton3"); // NOI18N

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        jLabel27.setFont(resourceMap.getFont("jLabel27.font")); // NOI18N
        jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
        jLabel27.setName("jLabel27"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
        jLabel30.setName("jLabel30"); // NOI18N

        jLabel33.setText(resourceMap.getString("jLabel33.text")); // NOI18N
        jLabel33.setName("jLabel33"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jLabel28.setFont(resourceMap.getFont("jLabel28.font")); // NOI18N
        jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
        jLabel28.setName("jLabel28"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jLabel37.setFont(resourceMap.getFont("jLabel40.font")); // NOI18N
        jLabel37.setForeground(resourceMap.getColor("jLabel37.foreground")); // NOI18N
        jLabel37.setText(resourceMap.getString("jLabel37.text")); // NOI18N
        jLabel37.setName("jLabel37"); // NOI18N

        jLabel36.setFont(resourceMap.getFont("jLabel40.font")); // NOI18N
        jLabel36.setForeground(resourceMap.getColor("jLabel36.foreground")); // NOI18N
        jLabel36.setText(resourceMap.getString("jLabel36.text")); // NOI18N
        jLabel36.setName("jLabel36"); // NOI18N

        jLabel43.setFont(resourceMap.getFont("jLabel40.font")); // NOI18N
        jLabel43.setForeground(resourceMap.getColor("jLabel43.foreground")); // NOI18N
        jLabel43.setText(resourceMap.getString("jLabel43.text")); // NOI18N
        jLabel43.setName("jLabel43"); // NOI18N

        jLabel42.setFont(resourceMap.getFont("jLabel40.font")); // NOI18N
        jLabel42.setForeground(resourceMap.getColor("jLabel42.foreground")); // NOI18N
        jLabel42.setText(resourceMap.getString("jLabel42.text")); // NOI18N
        jLabel42.setName("jLabel42"); // NOI18N

        jLabel39.setFont(resourceMap.getFont("jLabel40.font")); // NOI18N
        jLabel39.setForeground(resourceMap.getColor("jLabel39.foreground")); // NOI18N
        jLabel39.setText(resourceMap.getString("jLabel39.text")); // NOI18N
        jLabel39.setName("jLabel39"); // NOI18N

        jLabel41.setFont(resourceMap.getFont("jLabel40.font")); // NOI18N
        jLabel41.setForeground(resourceMap.getColor("jLabel41.foreground")); // NOI18N
        jLabel41.setText(resourceMap.getString("jLabel41.text")); // NOI18N
        jLabel41.setName("jLabel41"); // NOI18N

        jLabel29.setFont(resourceMap.getFont("jLabel29.font")); // NOI18N
        jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
        jLabel29.setName("jLabel29"); // NOI18N

        jLabel35.setText(resourceMap.getString("jLabel35.text")); // NOI18N
        jLabel35.setName("jLabel35"); // NOI18N

        jLabel50.setFont(resourceMap.getFont("jLabel44.font")); // NOI18N
        jLabel50.setForeground(resourceMap.getColor("jLabel44.foreground")); // NOI18N
        jLabel50.setText(resourceMap.getString("jLabel50.text")); // NOI18N
        jLabel50.setName("jLabel50"); // NOI18N

        jLabel46.setFont(resourceMap.getFont("jLabel44.font")); // NOI18N
        jLabel46.setForeground(resourceMap.getColor("jLabel44.foreground")); // NOI18N
        jLabel46.setText(resourceMap.getString("jLabel46.text")); // NOI18N
        jLabel46.setName("jLabel46"); // NOI18N

        jLabel48.setFont(resourceMap.getFont("jLabel44.font")); // NOI18N
        jLabel48.setForeground(resourceMap.getColor("jLabel44.foreground")); // NOI18N
        jLabel48.setText(resourceMap.getString("jLabel48.text")); // NOI18N
        jLabel48.setName("jLabel48"); // NOI18N

        jLabel44.setFont(resourceMap.getFont("jLabel44.font")); // NOI18N
        jLabel44.setForeground(resourceMap.getColor("jLabel44.foreground")); // NOI18N
        jLabel44.setText(resourceMap.getString("jLabel44.text")); // NOI18N
        jLabel44.setName("jLabel44"); // NOI18N

        jLabel31.setText(resourceMap.getString("jLabel31.text")); // NOI18N
        jLabel31.setName("jLabel31"); // NOI18N

        jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
        jLabel26.setName("jLabel26"); // NOI18N

        jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
        jLabel24.setName("jLabel24"); // NOI18N

        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jLabel156.setText(resourceMap.getString("jLabel156.text")); // NOI18N
        jLabel156.setName("jLabel156"); // NOI18N

        jLabel157.setText(resourceMap.getString("jLabel157.text")); // NOI18N
        jLabel157.setName("jLabel157"); // NOI18N

        jLabel158.setText(resourceMap.getString("jLabel158.text")); // NOI18N
        jLabel158.setName("jLabel158"); // NOI18N

        jLabel159.setText(resourceMap.getString("jLabel159.text")); // NOI18N
        jLabel159.setName("jLabel159"); // NOI18N

        jLabel160.setText(resourceMap.getString("jLabel160.text")); // NOI18N
        jLabel160.setName("jLabel160"); // NOI18N

        jLabel161.setText(resourceMap.getString("jLabel161.text")); // NOI18N
        jLabel161.setName("jLabel161"); // NOI18N

        jLabel162.setText(resourceMap.getString("jLabel162.text")); // NOI18N
        jLabel162.setName("jLabel162"); // NOI18N

        jLabel163.setText(resourceMap.getString("jLabel163.text")); // NOI18N
        jLabel163.setName("jLabel163"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(94, 94, 94)
                        .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel30)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel158)
                                    .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel159)))
                            .addComponent(jLabel156)
                            .addComponent(jLabel157))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel33, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel28)
                            .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel160)
                            .addComponent(jLabel161))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel29)
                                    .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel35, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel39, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel43, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel42))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel50, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel36)
                                    .addComponent(jLabel46, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel48, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel44, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jLabel162)
                            .addComponent(jLabel163))))
                .addContainerGap(103, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel3, jLabel30, jLabel31, jLabel4, jLabel5, jLabel6, jLabel7, jLabel8, jLabel9});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(13, 13, 13)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel29)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel26)
                                .addGap(4, 4, 4)
                                .addComponent(jLabel24)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel20)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel21)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel35))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(27, 27, 27)
                                        .addComponent(jLabel12))
                                    .addComponent(jLabel28))
                                .addGap(4, 4, 4)
                                .addComponent(jLabel14)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel16)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel18)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel33)))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel42)
                                .addComponent(jLabel36))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel43)
                                .addComponent(jLabel50))
                            .addGap(4, 4, 4)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel37)
                                .addComponent(jLabel46))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel39)
                                .addComponent(jLabel48))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel41)
                                .addComponent(jLabel44))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(27, 27, 27)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4)))
                            .addComponent(jLabel27))
                        .addGap(4, 4, 4)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel30)
                            .addComponent(jLabel31))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel156)
                            .addComponent(jLabel158))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel157)
                            .addComponent(jLabel159)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel160)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel161))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel162)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel163)))
                .addGap(15, 15, 15))
        );

        jLabel42.getAccessibleContext().setAccessibleName(resourceMap.getString("jLabel42.AccessibleContext.accessibleName")); // NOI18N

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel2.setName("jPanel2"); // NOI18N

        jLabel52.setFont(resourceMap.getFont("jLabel52.font")); // NOI18N
        jLabel52.setText(resourceMap.getString("jLabel52.text")); // NOI18N
        jLabel52.setName("jLabel52"); // NOI18N

        jLabel53.setText(resourceMap.getString("jLabel53.text")); // NOI18N
        jLabel53.setName("jLabel53"); // NOI18N

        jLabel54.setText(resourceMap.getString("jLabel54.text")); // NOI18N
        jLabel54.setName("jLabel54"); // NOI18N

        jLabel55.setText(resourceMap.getString("jLabel55.text")); // NOI18N
        jLabel55.setName("jLabel55"); // NOI18N

        jLabel57.setText(resourceMap.getString("jLabel57.text")); // NOI18N
        jLabel57.setName("jLabel57"); // NOI18N

        jLabel58.setText(resourceMap.getString("jLabel58.text")); // NOI18N
        jLabel58.setName("jLabel58"); // NOI18N

        jLabel59.setText(resourceMap.getString("jLabel59.text")); // NOI18N
        jLabel59.setName("jLabel59"); // NOI18N

        jLabel60.setText(resourceMap.getString("jLabel60.text")); // NOI18N
        jLabel60.setName("jLabel60"); // NOI18N

        jLabel62.setText(resourceMap.getString("jLabel62.text")); // NOI18N
        jLabel62.setName("jLabel62"); // NOI18N

        jLabel63.setText(resourceMap.getString("jLabel63.text")); // NOI18N
        jLabel63.setName("jLabel63"); // NOI18N

        jLabel64.setText(resourceMap.getString("jLabel64.text")); // NOI18N
        jLabel64.setName("jLabel64"); // NOI18N

        jLabel65.setText(resourceMap.getString("jLabel65.text")); // NOI18N
        jLabel65.setName("jLabel65"); // NOI18N

        jLabel56.setText(resourceMap.getString("jLabel56.text")); // NOI18N
        jLabel56.setName("jLabel56"); // NOI18N

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel34.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel34.setText(resourceMap.getString("jLabel34.text")); // NOI18N
        jLabel34.setName("jLabel34"); // NOI18N

        jLabel38.setFont(resourceMap.getFont("jLabel38.font")); // NOI18N
        jLabel38.setText(resourceMap.getString("jLabel38.text")); // NOI18N
        jLabel38.setName("jLabel38"); // NOI18N

        jLabel40.setFont(resourceMap.getFont("jLabel40.font")); // NOI18N
        jLabel40.setText(resourceMap.getString("jLabel40.text")); // NOI18N
        jLabel40.setName("jLabel40"); // NOI18N

        jLabel164.setFont(resourceMap.getFont("jLabel164.font")); // NOI18N
        jLabel164.setText(resourceMap.getString("jLabel164.text")); // NOI18N
        jLabel164.setName("jLabel164"); // NOI18N

        jLabel165.setText(resourceMap.getString("jLabel165.text")); // NOI18N
        jLabel165.setName("jLabel165"); // NOI18N

        jLabel166.setText(resourceMap.getString("jLabel166.text")); // NOI18N
        jLabel166.setName("jLabel166"); // NOI18N

        jLabel167.setText(resourceMap.getString("jLabel167.text")); // NOI18N
        jLabel167.setName("jLabel167"); // NOI18N

        jLabel168.setText(resourceMap.getString("jLabel168.text")); // NOI18N
        jLabel168.setName("jLabel168"); // NOI18N

        jLabel169.setFont(resourceMap.getFont("jLabel169.font")); // NOI18N
        jLabel169.setText(resourceMap.getString("jLabel169.text")); // NOI18N
        jLabel169.setName("jLabel169"); // NOI18N

        jLabel170.setText(resourceMap.getString("jLabel170.text")); // NOI18N
        jLabel170.setName("jLabel170"); // NOI18N

        jLabel171.setText(resourceMap.getString("jLabel171.text")); // NOI18N
        jLabel171.setName("jLabel171"); // NOI18N

        jLabel172.setText(resourceMap.getString("jLabel172.text")); // NOI18N
        jLabel172.setName("jLabel172"); // NOI18N

        jLabel173.setText(resourceMap.getString("jLabel173.text")); // NOI18N
        jLabel173.setName("jLabel173"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel52)
                    .addComponent(jLabel15)
                    .addComponent(jLabel13)
                    .addComponent(jLabel11)
                    .addComponent(jLabel17))
                .addGap(31, 31, 31)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel53, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel54, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel55, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel56, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel34, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel57, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel58, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel60, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel59, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel38))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel40)
                            .addComponent(jLabel62, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel164)
                            .addComponent(jLabel165, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel63, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel166, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel64, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel167, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel65, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel168, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(51, 51, 51)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel173, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel172, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel171, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel170, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel169))
                .addContainerGap(48, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel52)
                    .addComponent(jLabel34)
                    .addComponent(jLabel38)
                    .addComponent(jLabel40)
                    .addComponent(jLabel164)
                    .addComponent(jLabel169))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel11))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel53)
                        .addGap(4, 4, 4)
                        .addComponent(jLabel54)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel55))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel57)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel62)
                                .addComponent(jLabel165)
                                .addComponent(jLabel170)))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(4, 4, 4)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel63)
                                            .addComponent(jLabel166))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel64)
                                            .addComponent(jLabel167))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel65)
                                            .addComponent(jLabel168)))
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addComponent(jLabel58)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel59)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel60)
                                            .addComponent(jLabel56)))))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel171)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel172)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel173)))))
                .addContainerGap(95, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        jPanel3.setName("jPanel3"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N

        jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N
        jTextField1.setName("jTextField1"); // NOI18N
        jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
        });

        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
        jLabel23.setName("jLabel23"); // NOI18N

        jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
        jLabel25.setName("jLabel25"); // NOI18N

        jLabel32.setText(resourceMap.getString("jLabel32.text")); // NOI18N
        jLabel32.setName("jLabel32"); // NOI18N

        jLabel45.setText(resourceMap.getString("jLabel45.text")); // NOI18N
        jLabel45.setName("jLabel45"); // NOI18N

        jLabel47.setText(resourceMap.getString("jLabel47.text")); // NOI18N
        jLabel47.setName("jLabel47"); // NOI18N

        jLabel49.setText(resourceMap.getString("jLabel49.text")); // NOI18N
        jLabel49.setName("jLabel49"); // NOI18N

        jLabel51.setText(resourceMap.getString("jLabel51.text")); // NOI18N
        jLabel51.setName("jLabel51"); // NOI18N

        jLabel61.setText(resourceMap.getString("jLabel61.text")); // NOI18N
        jLabel61.setName("jLabel61"); // NOI18N

        jLabel66.setText(resourceMap.getString("jLabel66.text")); // NOI18N
        jLabel66.setName("jLabel66"); // NOI18N

        jLabel67.setText(resourceMap.getString("jLabel67.text")); // NOI18N
        jLabel67.setName("jLabel67"); // NOI18N

        jLabel68.setText(resourceMap.getString("jLabel68.text")); // NOI18N
        jLabel68.setName("jLabel68"); // NOI18N

        jLabel69.setText(resourceMap.getString("jLabel69.text")); // NOI18N
        jLabel69.setName("jLabel69"); // NOI18N

        jLabel70.setText(resourceMap.getString("jLabel70.text")); // NOI18N
        jLabel70.setName("jLabel70"); // NOI18N

        jLabel71.setText(resourceMap.getString("jLabel71.text")); // NOI18N
        jLabel71.setName("jLabel71"); // NOI18N

        jLabel72.setText(resourceMap.getString("jLabel72.text")); // NOI18N
        jLabel72.setName("jLabel72"); // NOI18N

        jLabel73.setText(resourceMap.getString("jLabel73.text")); // NOI18N
        jLabel73.setName("jLabel73"); // NOI18N

        jLabel74.setText(resourceMap.getString("jLabel74.text")); // NOI18N
        jLabel74.setName("jLabel74"); // NOI18N

        jLabel75.setText(resourceMap.getString("jLabel75.text")); // NOI18N
        jLabel75.setName("jLabel75"); // NOI18N

        jLabel76.setText(resourceMap.getString("jLabel76.text")); // NOI18N
        jLabel76.setName("jLabel76"); // NOI18N

        jLabel77.setText(resourceMap.getString("jLabel77.text")); // NOI18N
        jLabel77.setName("jLabel77"); // NOI18N

        jLabel78.setText(resourceMap.getString("jLabel78.text")); // NOI18N
        jLabel78.setName("jLabel78"); // NOI18N

        jLabel79.setText(resourceMap.getString("jLabel79.text")); // NOI18N
        jLabel79.setName("jLabel79"); // NOI18N

        jLabel80.setText(resourceMap.getString("jLabel80.text")); // NOI18N
        jLabel80.setName("jLabel80"); // NOI18N

        jLabel81.setText(resourceMap.getString("jLabel81.text")); // NOI18N
        jLabel81.setName("jLabel81"); // NOI18N

        jLabel117.setText(resourceMap.getString("jLabel117.text")); // NOI18N
        jLabel117.setName("jLabel117"); // NOI18N

        jLabel118.setText(resourceMap.getString("jLabel118.text")); // NOI18N
        jLabel118.setName("jLabel118"); // NOI18N

        jLabel119.setText(resourceMap.getString("jLabel119.text")); // NOI18N
        jLabel119.setName("jLabel119"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel25)
                    .addComponent(jLabel49)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel22)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel23)
                                .addGap(36, 36, 36)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel51, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel61, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel32)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel66, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel45)
                                    .addComponent(jLabel47))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel68, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel67, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel69, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(54, 54, 54)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel70, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel71, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel72, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel73, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel74, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel75, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(40, 40, 40)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel81, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel80, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel79, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel78, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel77, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel76, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel19)))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel117, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE)
                                .addContainerGap())))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel118)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel119, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(416, Short.MAX_VALUE))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel117))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addComponent(jLabel19))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel70)
                            .addComponent(jLabel76))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel71)
                            .addComponent(jLabel77))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel72)
                            .addComponent(jLabel78))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel73)
                            .addComponent(jLabel79))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel74)
                            .addComponent(jLabel80))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel75)
                            .addComponent(jLabel81)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel23)
                            .addComponent(jLabel51))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel25)
                            .addComponent(jLabel61))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel32)
                            .addComponent(jLabel66))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel45)
                            .addComponent(jLabel67))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel47)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel49)
                                    .addComponent(jLabel69)))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel68)
                                .addGap(20, 20, 20)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel118)
                    .addComponent(jLabel119))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

        jPanel7.setName("jPanel7"); // NOI18N

        jLabel175.setText(resourceMap.getString("jLabel175.text")); // NOI18N
        jLabel175.setName("jLabel175"); // NOI18N

        jTextField2.setText(resourceMap.getString("jTextField2.text")); // NOI18N
        jTextField2.setName("jTextField2"); // NOI18N
        jTextField2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField2KeyReleased(evt);
            }
        });

        jLabel176.setText(resourceMap.getString("jLabel176.text")); // NOI18N
        jLabel176.setName("jLabel176"); // NOI18N

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Consulta", "Establecer", "Añadir", "Retirar", "Eliminar" }));
        jComboBox2.setName("cmb_stock_operacion"); // NOI18N
        jComboBox2.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                habilitacomponentesStock(evt);
            }
        });

        jLabel177.setText(resourceMap.getString("jLabel177.text")); // NOI18N
        jLabel177.setName("jLabel177"); // NOI18N

        jTextField3.setText(resourceMap.getString("jTextField3.text")); // NOI18N
        jTextField3.setName("jTextField3"); // NOI18N
        jTextField3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField3KeyReleased(evt);
            }
        });

        jButton4.setAction(actionMap.get("guardarStock")); // NOI18N
        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N

        jPanel8.setBackground(resourceMap.getColor("jPanel8.background")); // NOI18N
        jPanel8.setName("jPanel8"); // NOI18N

        jLabel178.setText(resourceMap.getString("jLabel178.text")); // NOI18N
        jLabel178.setName("jLabel178"); // NOI18N

        jLabel179.setText(resourceMap.getString("jLabel179.text")); // NOI18N
        jLabel179.setName("jLabel179"); // NOI18N

        jLabel180.setText(resourceMap.getString("jLabel180.text")); // NOI18N
        jLabel180.setName("jLabel180"); // NOI18N

        jLabel181.setText(resourceMap.getString("jLabel181.text")); // NOI18N
        jLabel181.setName("jLabel181"); // NOI18N

        jLabel182.setText(resourceMap.getString("jLabel182.text")); // NOI18N
        jLabel182.setName("jLabel182"); // NOI18N

        jLabel183.setText(resourceMap.getString("jLabel183.text")); // NOI18N
        jLabel183.setName("jLabel183"); // NOI18N

        jLabel184.setText(resourceMap.getString("jLabel184.text")); // NOI18N
        jLabel184.setName("jLabel184"); // NOI18N

        jLabel185.setText(resourceMap.getString("jLabel185.text")); // NOI18N
        jLabel185.setName("jLabel185"); // NOI18N

        jLabel186.setText(resourceMap.getString("jLabel186.text")); // NOI18N
        jLabel186.setName("jLabel186"); // NOI18N

        jLabel187.setText(resourceMap.getString("jLabel187.text")); // NOI18N
        jLabel187.setName("jLabel187"); // NOI18N

        jLabel188.setText(resourceMap.getString("jLabel188.text")); // NOI18N
        jLabel188.setName("jLabel188"); // NOI18N

        jLabel189.setText(resourceMap.getString("jLabel189.text")); // NOI18N
        jLabel189.setName("jLabel189"); // NOI18N

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel180, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel178, javax.swing.GroupLayout.Alignment.LEADING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 137, Short.MAX_VALUE)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel179, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel181, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel182)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 116, Short.MAX_VALUE)
                        .addComponent(jLabel183, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel186)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
                        .addComponent(jLabel187, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel184)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 104, Short.MAX_VALUE)
                        .addComponent(jLabel185, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel188)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 150, Short.MAX_VALUE)
                        .addComponent(jLabel189, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel178)
                    .addComponent(jLabel179))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel180)
                    .addComponent(jLabel181))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel182)
                    .addComponent(jLabel183))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel188)
                    .addComponent(jLabel189))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel184)
                    .addComponent(jLabel185))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel186)
                    .addComponent(jLabel187))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel175)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel176)
                                .addGap(18, 18, 18)
                                .addComponent(jTextField2))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel177)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField3))))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(55, 55, 55)
                        .addComponent(jButton4)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel175)
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel176)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel177)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addComponent(jButton4))
            .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

        jPanel4.setName("jPanel4"); // NOI18N

        jLabel83.setText(resourceMap.getString("jLabel83.text")); // NOI18N
        jLabel83.setName("jLabel83"); // NOI18N

        jLabel84.setText(resourceMap.getString("jLabel84.text")); // NOI18N
        jLabel84.setName("jLabel84"); // NOI18N

        jLabel85.setText(resourceMap.getString("jLabel85.text")); // NOI18N
        jLabel85.setName("jLabel85"); // NOI18N

        jLabel86.setText(resourceMap.getString("jLabel86.text")); // NOI18N
        jLabel86.setName("jLabel86"); // NOI18N

        jLabel87.setText(resourceMap.getString("Importe.text")); // NOI18N
        jLabel87.setName("Importe"); // NOI18N

        jLabel88.setText(resourceMap.getString("jLabel88.text")); // NOI18N
        jLabel88.setName("jLabel88"); // NOI18N

        jLabel89.setText(resourceMap.getString("jLabel89.text")); // NOI18N
        jLabel89.setName("jLabel89"); // NOI18N

        jLabel90.setText(resourceMap.getString("jLabel90.text")); // NOI18N
        jLabel90.setName("jLabel90"); // NOI18N

        jLabel91.setText(resourceMap.getString("jLabel91.text")); // NOI18N
        jLabel91.setName("jLabel91"); // NOI18N

        jLabel92.setText(resourceMap.getString("jLabel92.text")); // NOI18N
        jLabel92.setName("jLabel92"); // NOI18N

        jLabel93.setText(resourceMap.getString("jLabel93.text")); // NOI18N
        jLabel93.setName("jLabel93"); // NOI18N

        jLabel94.setText(resourceMap.getString("jLabel94.text")); // NOI18N
        jLabel94.setName("jLabel94"); // NOI18N

        jLabel95.setText(resourceMap.getString("jLabel95.text")); // NOI18N
        jLabel95.setName("jLabel95"); // NOI18N

        jLabel96.setText(resourceMap.getString("jLabel96.text")); // NOI18N
        jLabel96.setName("jLabel96"); // NOI18N

        jLabel97.setText(resourceMap.getString("jLabel97.text")); // NOI18N
        jLabel97.setName("jLabel97"); // NOI18N

        jLabel98.setText(resourceMap.getString("jLabel98.text")); // NOI18N
        jLabel98.setName("jLabel98"); // NOI18N

        jLabel99.setText(resourceMap.getString("jLabel99.text")); // NOI18N
        jLabel99.setName("jLabel99"); // NOI18N

        jLabel100.setText(resourceMap.getString("jLabel100.text")); // NOI18N
        jLabel100.setName("jLabel100"); // NOI18N

        jLabel101.setText(resourceMap.getString("jLabel101.text")); // NOI18N
        jLabel101.setName("jLabel101"); // NOI18N

        jLabel102.setText(resourceMap.getString("jLabel102.text")); // NOI18N
        jLabel102.setName("jLabel102"); // NOI18N

        jLabel103.setText(resourceMap.getString("jLabel103.text")); // NOI18N
        jLabel103.setName("jLabel103"); // NOI18N

        jLabel104.setText(resourceMap.getString("jLabel104.text")); // NOI18N
        jLabel104.setName("jLabel104"); // NOI18N

        jLabel105.setText(resourceMap.getString("jLabel105.text")); // NOI18N
        jLabel105.setName("jLabel105"); // NOI18N

        jLabel106.setText(resourceMap.getString("jLabel106.text")); // NOI18N
        jLabel106.setName("jLabel106"); // NOI18N

        jLabel107.setText(resourceMap.getString("jLabel107.text")); // NOI18N
        jLabel107.setName("jLabel107"); // NOI18N

        jLabel108.setText(resourceMap.getString("jLabel108.text")); // NOI18N
        jLabel108.setName("jLabel108"); // NOI18N

        jLabel109.setText(resourceMap.getString("jLabel109.text")); // NOI18N
        jLabel109.setName("jLabel109"); // NOI18N

        jLabel110.setText(resourceMap.getString("jLabel110.text")); // NOI18N
        jLabel110.setName("jLabel110"); // NOI18N

        jLabel111.setText(resourceMap.getString("jLabel111.text")); // NOI18N
        jLabel111.setName("jLabel111"); // NOI18N

        jLabel112.setText(resourceMap.getString("jLabel112.text")); // NOI18N
        jLabel112.setName("jLabel112"); // NOI18N

        jLabel113.setText(resourceMap.getString("jLabel113.text")); // NOI18N
        jLabel113.setName("jLabel113"); // NOI18N

        jLabel114.setText(resourceMap.getString("jLabel114.text")); // NOI18N
        jLabel114.setName("jLabel114"); // NOI18N

        jLabel115.setText(resourceMap.getString("jLabel115.text")); // NOI18N
        jLabel115.setName("jLabel115"); // NOI18N

        jLabel116.setText(resourceMap.getString("jLabel116.text")); // NOI18N
        jLabel116.setName("jLabel116"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel99)
                    .addComponent(jLabel105)
                    .addComponent(jLabel111)
                    .addComponent(jLabel93)
                    .addComponent(jLabel83))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel100, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel106, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel112, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel94, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel86)
                    .addComponent(jLabel84, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel101, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel107, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel95, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel87)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel85, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel113, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(108, 108, 108)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel102)
                    .addComponent(jLabel108)
                    .addComponent(jLabel114)
                    .addComponent(jLabel96)
                    .addComponent(jLabel88))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel103, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel109, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel115, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel97, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel91)
                    .addComponent(jLabel89, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel92, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel104, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel110, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel116, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel98, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel90, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(23, 23, 23))
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel84, jLabel87});

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel101, jLabel104, jLabel107, jLabel110, jLabel113, jLabel116, jLabel85, jLabel90, jLabel95, jLabel98});

        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel87)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel85)
                        .addGap(10, 10, 10)
                        .addComponent(jLabel95)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel101)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel107)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel113))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel83)
                        .addGap(10, 10, 10)
                        .addComponent(jLabel93)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel99)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel105)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel111))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel86)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel84)
                        .addGap(10, 10, 10)
                        .addComponent(jLabel94)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel100)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel106)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel112))
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addGap(28, 28, 28)
                            .addComponent(jLabel96)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel102)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel108)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel114))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                            .addComponent(jLabel88)
                            .addGap(88, 88, 88)))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel91)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGap(28, 28, 28)
                                .addComponent(jLabel97)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel103)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel109)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel115))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel89)
                                .addGap(88, 88, 88))))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel92)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGap(28, 28, 28)
                                .addComponent(jLabel98)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel104)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel110)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel116))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel90)
                                .addGap(88, 88, 88)))))
                .addContainerGap(69, Short.MAX_VALUE))
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel101, jLabel107, jLabel113, jLabel84, jLabel85, jLabel87, jLabel95});

        jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

        jPanel5.setName("jPanel5"); // NOI18N

        jPanel6.setBackground(resourceMap.getColor("jPanel6.background")); // NOI18N
        jPanel6.setName("jPanel6"); // NOI18N

        jLabel148.setText(resourceMap.getString("jLabel148.text")); // NOI18N
        jLabel148.setName("jLabel148"); // NOI18N

        jLabel149.setText(resourceMap.getString("jLabel149.text")); // NOI18N
        jLabel149.setName("jLabel149"); // NOI18N

        jLabel150.setText(resourceMap.getString("jLabel150.text")); // NOI18N
        jLabel150.setName("jLabel150"); // NOI18N

        jLabel151.setText(resourceMap.getString("jLabel151.text")); // NOI18N
        jLabel151.setName("jLabel151"); // NOI18N

        jLabel152.setText(resourceMap.getString("jLabel152.text")); // NOI18N
        jLabel152.setName("jLabel152"); // NOI18N

        jLabel153.setText(resourceMap.getString("jLabel153.text")); // NOI18N
        jLabel153.setName("jLabel153"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel148)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(58, Short.MAX_VALUE)
                .addComponent(jLabel149)
                .addContainerGap())
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel150)
                .addContainerGap(18, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(58, Short.MAX_VALUE)
                .addComponent(jLabel151)
                .addContainerGap())
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel152)
                .addContainerGap(13, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(58, Short.MAX_VALUE)
                .addComponent(jLabel153)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel148)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel149)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel150)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel151)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel152)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel153)
                .addContainerGap(60, Short.MAX_VALUE))
        );

        jLabel120.setText(resourceMap.getString("jLabel120.text")); // NOI18N
        jLabel120.setName("jLabel120"); // NOI18N

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--Seleecione--" }));
        jComboBox1.setAction(actionMap.get("cargarDatosCliente")); // NOI18N
        jComboBox1.setName("jComboBox1"); // NOI18N

        jLabel121.setText(resourceMap.getString("jLabel121.text")); // NOI18N
        jLabel121.setName("jLabel121"); // NOI18N

        jLabel122.setText(resourceMap.getString("jLabel122.text")); // NOI18N
        jLabel122.setName("jLabel122"); // NOI18N

        jLabel123.setText(resourceMap.getString("jLabel123.text")); // NOI18N
        jLabel123.setName("jLabel123"); // NOI18N

        jLabel124.setText(resourceMap.getString("jLabel124.text")); // NOI18N
        jLabel124.setName("jLabel124"); // NOI18N

        jLabel125.setText(resourceMap.getString("jLabel125.text")); // NOI18N
        jLabel125.setName("jLabel125"); // NOI18N

        jLabel126.setText(resourceMap.getString("jLabel126.text")); // NOI18N
        jLabel126.setName("jLabel126"); // NOI18N

        jLabel127.setFont(resourceMap.getFont("jLabel127.font")); // NOI18N
        jLabel127.setText(resourceMap.getString("jLabel127.text")); // NOI18N
        jLabel127.setName("jLabel127"); // NOI18N

        jLabel128.setText(resourceMap.getString("jLabel128.text")); // NOI18N
        jLabel128.setName("jLabel128"); // NOI18N

        jLabel129.setText(resourceMap.getString("jLabel129.text")); // NOI18N
        jLabel129.setName("jLabel129"); // NOI18N

        jLabel130.setText(resourceMap.getString("jLabel130.text")); // NOI18N
        jLabel130.setName("jLabel130"); // NOI18N

        jLabel131.setText(resourceMap.getString("jLabel131.text")); // NOI18N
        jLabel131.setName("jLabel131"); // NOI18N

        jLabel132.setText(resourceMap.getString("jLabel132.text")); // NOI18N
        jLabel132.setName("jLabel132"); // NOI18N

        jLabel133.setText(resourceMap.getString("jLabel133.text")); // NOI18N
        jLabel133.setName("jLabel133"); // NOI18N

        jLabel134.setFont(resourceMap.getFont("jLabel134.font")); // NOI18N
        jLabel134.setText(resourceMap.getString("jLabel134.text")); // NOI18N
        jLabel134.setName("jLabel134"); // NOI18N

        jLabel135.setText(resourceMap.getString("jLabel135.text")); // NOI18N
        jLabel135.setName("jLabel135"); // NOI18N

        jLabel136.setText(resourceMap.getString("jLabel136.text")); // NOI18N
        jLabel136.setName("jLabel136"); // NOI18N

        jLabel137.setText(resourceMap.getString("jLabel137.text")); // NOI18N
        jLabel137.setName("jLabel137"); // NOI18N

        jLabel138.setText(resourceMap.getString("jLabel138.text")); // NOI18N
        jLabel138.setName("jLabel138"); // NOI18N

        jLabel139.setText(resourceMap.getString("jLabel139.text")); // NOI18N
        jLabel139.setName("jLabel139"); // NOI18N

        jLabel140.setText(resourceMap.getString("jLabel140.text")); // NOI18N
        jLabel140.setName("jLabel140"); // NOI18N

        jLabel141.setFont(resourceMap.getFont("jLabel141.font")); // NOI18N
        jLabel141.setText(resourceMap.getString("jLabel141.text")); // NOI18N
        jLabel141.setName("jLabel141"); // NOI18N

        jLabel142.setText(resourceMap.getString("jLabel142.text")); // NOI18N
        jLabel142.setName("jLabel142"); // NOI18N

        jLabel143.setText(resourceMap.getString("jLabel143.text")); // NOI18N
        jLabel143.setName("jLabel143"); // NOI18N

        jLabel144.setText(resourceMap.getString("jLabel144.text")); // NOI18N
        jLabel144.setName("jLabel144"); // NOI18N

        jLabel145.setText(resourceMap.getString("jLabel145.text")); // NOI18N
        jLabel145.setName("jLabel145"); // NOI18N

        jLabel146.setText(resourceMap.getString("jLabel146.text")); // NOI18N
        jLabel146.setName("jLabel146"); // NOI18N

        jLabel147.setText(resourceMap.getString("jLabel147.text")); // NOI18N
        jLabel147.setName("jLabel147"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel120)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel121)
                            .addComponent(jLabel122)
                            .addComponent(jLabel123)
                            .addComponent(jLabel124)
                            .addComponent(jLabel125)
                            .addComponent(jLabel126))
                        .addGap(34, 34, 34)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel127)
                            .addComponent(jLabel128, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel129, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel130, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel131, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel132, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel133, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(39, 39, 39)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel140, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel139, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel138, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel137, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel136, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel135, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel134))))
                .addGap(45, 45, 45)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel141)
                    .addComponent(jLabel142, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel143, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel144, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel145, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel146, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel147, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 199, Short.MAX_VALUE)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel120)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel127)
                            .addComponent(jLabel134)
                            .addComponent(jLabel141))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel128)
                            .addComponent(jLabel121)
                            .addComponent(jLabel135)
                            .addComponent(jLabel142))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel122)
                            .addComponent(jLabel129)
                            .addComponent(jLabel136)
                            .addComponent(jLabel143))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel123)
                            .addComponent(jLabel130)
                            .addComponent(jLabel137)
                            .addComponent(jLabel144))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel124)
                            .addComponent(jLabel131)
                            .addComponent(jLabel138)
                            .addComponent(jLabel145))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel125)
                            .addComponent(jLabel132)
                            .addComponent(jLabel139)
                            .addComponent(jLabel146))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel126)
                            .addComponent(jLabel133)
                            .addComponent(jLabel140)
                            .addComponent(jLabel147))))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

        jCalendar1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jCalendar1.border.title"))); // NOI18N
        jCalendar1.setName("jCalendar1"); // NOI18N

        jCalendar2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jCalendar2.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, resourceMap.getColor("jCalendar2.border.titleColor"))); // NOI18N
        jCalendar2.setName("jCalendar2"); // NOI18N

        jLabel82.setText(resourceMap.getString("jLabel82.text")); // NOI18N
        jLabel82.setName("jLabel82"); // NOI18N

        jLabel154.setText(resourceMap.getString("jLabel154.text")); // NOI18N
        jLabel154.setName("jLabel154"); // NOI18N

        jLabel155.setText(resourceMap.getString("jLabel155.text")); // NOI18N
        jLabel155.setName("jLabel155"); // NOI18N

        jButton6.setAction(actionMap.get("btn_reset_maximo_tiempo_ppal")); // NOI18N
        jButton6.setText(resourceMap.getString("jButton6.text")); // NOI18N
        jButton6.setName("jButton6"); // NOI18N

        jButton7.setAction(actionMap.get("crear_informes")); // NOI18N
        jButton7.setText(resourceMap.getString("jButton7.text")); // NOI18N
        jButton7.setName("jButton7"); // NOI18N

        jProgressBar1.setName("jProgressBar1"); // NOI18N
        jProgressBar1.setStringPainted(true);

        jLabel174.setForeground(resourceMap.getColor("jLabel174.foreground")); // NOI18N
        jLabel174.setText(resourceMap.getString("jLabel174.text")); // NOI18N
        jLabel174.setName("jLabel174"); // NOI18N

        jSlider1.setMaximum(60);
        jSlider1.setMinimum(1);
        jSlider1.setPaintLabels(true);
        jSlider1.setPaintTicks(true);
        jSlider1.setSnapToTicks(true);
        jSlider1.setToolTipText(resourceMap.getString("jSlider1.toolTipText")); // NOI18N
        jSlider1.setValue(10);
        jSlider1.setName("jSlider1"); // NOI18N
        jSlider1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jSlider1MouseReleased(evt);
            }
        });

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jCalendar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel174)
                            .addComponent(jLabel155)
                            .addComponent(jLabel154)
                            .addComponent(jLabel82)
                            .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton6))
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 628, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(41, Short.MAX_VALUE))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jCalendar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton2)
                            .addComponent(jButton6)))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel82)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel154)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel155)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel174)))
                .addGap(18, 18, 18)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(24, 24, 24))
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        jMenu1.setAction(actionMap.get("showConfiguracion")); // NOI18N
        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jMenuItem1.setAction(actionMap.get("showConfiguracion")); // NOI18N
        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenu1.add(jMenuItem1);

        jMenuItem2.setAction(actionMap.get("showEfectivo")); // NOI18N
        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenu1.add(jMenuItem2);

        jMenuItem3.setAction(actionMap.get("reload_config")); // NOI18N
        jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        jMenu1.add(jMenuItem3);

        jMenuItem4.setAction(actionMap.get("showActualizaciones")); // NOI18N
        jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
        jMenuItem4.setName("jMenuItem4"); // NOI18N
        jMenu1.add(jMenuItem4);

        menuBar.add(jMenu1);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setText(resourceMap.getString("aboutMenuItem.text")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setComponent(mainPanel);
        setMenuBar(menuBar);
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased
        gestionarEventos(evt);
    }//GEN-LAST:event_jTextField1KeyReleased

    private void jSlider1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jSlider1MouseReleased
        jLabel174.setVisible(true);
        jLabel174.setText(""+jSlider1.getValue());
    }//GEN-LAST:event_jSlider1MouseReleased

    private void habilitacomponentesStock(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_habilitacomponentesStock
        boolean deshabilitar = jComboBox2.getSelectedIndex()>0;
        jLabel177.setVisible(deshabilitar);
        jTextField3.setVisible(deshabilitar);
        jButton4.setVisible(deshabilitar);
        if (jComboBox2.getSelectedIndex()==4){
            jTextField3.setVisible(false);
            jLabel177.setVisible(false);
        }
            
    }//GEN-LAST:event_habilitacomponentesStock

    private void jTextField2KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField2KeyReleased
        gestionarEventos(evt);
       
    }//GEN-LAST:event_jTextField2KeyReleased

    private void jTextField3KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField3KeyReleased
         int k = evt.getKeyCode();
        if (k == 10) {
            guardarStock();
            jTextField2.setText("");
            jTextField2.requestFocus();
        }
    }//GEN-LAST:event_jTextField3KeyReleased

    
    
    // ******************Actions************************************************
    @Action
    public void act_poner_fecha_hoy() {
        jCalendar1.setDate(new Date());
        jCalendar2.setDate(new Date());
    }

    @Action
    public void calcular() throws ParseException {
        iniciar_fechas();
        int pestana = jTabbedPane1.getSelectedIndex();
        switch (pestana) {
            case 0:
                calcularVentas();
                break;
            case 1:
                    calcularVentas();
                    calcularPrevision();
                
                break;
            case 2:
                calcularArticulos();
                break;
            case 3:
                calcularStock();
                break;
            case 4:
                calcularHoras();
                break;
            case 5:
                cargarDatosCliente();
        }

        actualizar_ritmo_ventas();
        cargarDatosCliente();
        actualizar_mensajes_agenda();

    }

    @Action
    public void imprimir_ticket() {
        Calendar c_encurso = Calendar.getInstance();
        c_encurso.setTime(new Date());
        FileOutputStream os = null;
        try {

            os = new FileOutputStream("COM6:");
            PrintStream ps = new PrintStream(os);

            ps.println("Informe");
            ps.println(c_encurso.get(Calendar.DAY_OF_MONTH) + "/" + c_encurso.get(Calendar.MONTH) + 1 + "/" + c_encurso.get(Calendar.YEAR));
            ps.println("No Ventas: " + jLabel4.getText());
            ps.println("Total din: " + jLabel6.getText());
            ps.println("Beneficio: " + jLabel8.getText());
            ps.println("Unidades : " + jLabel10.getText());
            ps.println("Recargas : " + jLabel31.getText());
            ps.close();
            FileWriter imp = new FileWriter("COM6");
            imp.write(29);
            imp.write(86);
            imp.write(66);
            imp.write(3);
            imp.close();

        } catch (FileNotFoundException ex) {
            Logger.getLogger(VentasDiaView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception e) {
            Logger.getLogger(VentasDiaView.class.getName()).log(Level.SEVERE, null, e);
        } finally {
            try {
                os.close();
            } catch (IOException ex) {
                Logger.getLogger(VentasDiaView.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }

    @Action
    public void reload_config() {
        recargar_Configuracion();
    }

    @Action
    public void cargarDatosCliente() throws ParseException {
        if (jComboBox1.getSelectedIndex() > 0) {
            cdc();
        }
    }

    @Action
    public void btn_reset_maximo_tiempo_ppal() {
        maxtiempo = 0;
    }

    @Action
    public void crear_informes() {
        // Informes posibles 0,1 --> Ventas
        // 2 --> Articulos
        // 4 --> Clientes
        int pestana = jTabbedPane1.getSelectedIndex();
        switch (pestana) {
            case 0:
                hiloVentas = new ThreadInformeVentas();
                hiloVentas.start();
                break;
            case 1:
                hiloPedidos = new ThreadInformePedido();
                hiloPedidos.start();
                break;
            case 2:
                hiloArticulos = new ThreadInformeArticulos();
                hiloArticulos.start();
                break;
            case 3:
                hiloStock = new ThreadInformeStock();
                hiloStock.start();
                break;
            case 4:
                hiloArticulosHoy = new ThreadInformeArticulosHoy();
                hiloArticulosHoy.start();
                break;
            case 5:
                
                hiloClientes = new ThreadInformeClientes();
                hiloClientes.start();
                break;
        }
    }
    //Actions-------------------------------------------------------------------------------------------
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private com.toedter.calendar.JCalendar jCalendar1;
    private com.toedter.calendar.JCalendar jCalendar2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel100;
    private javax.swing.JLabel jLabel101;
    private javax.swing.JLabel jLabel102;
    private javax.swing.JLabel jLabel103;
    private javax.swing.JLabel jLabel104;
    private javax.swing.JLabel jLabel105;
    private javax.swing.JLabel jLabel106;
    private javax.swing.JLabel jLabel107;
    private javax.swing.JLabel jLabel108;
    private javax.swing.JLabel jLabel109;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel110;
    private javax.swing.JLabel jLabel111;
    private javax.swing.JLabel jLabel112;
    private javax.swing.JLabel jLabel113;
    private javax.swing.JLabel jLabel114;
    private javax.swing.JLabel jLabel115;
    private javax.swing.JLabel jLabel116;
    private javax.swing.JLabel jLabel117;
    private javax.swing.JLabel jLabel118;
    private javax.swing.JLabel jLabel119;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel120;
    private javax.swing.JLabel jLabel121;
    private javax.swing.JLabel jLabel122;
    private javax.swing.JLabel jLabel123;
    private javax.swing.JLabel jLabel124;
    private javax.swing.JLabel jLabel125;
    private javax.swing.JLabel jLabel126;
    private javax.swing.JLabel jLabel127;
    private javax.swing.JLabel jLabel128;
    private javax.swing.JLabel jLabel129;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel130;
    private javax.swing.JLabel jLabel131;
    private javax.swing.JLabel jLabel132;
    private javax.swing.JLabel jLabel133;
    private javax.swing.JLabel jLabel134;
    private javax.swing.JLabel jLabel135;
    private javax.swing.JLabel jLabel136;
    private javax.swing.JLabel jLabel137;
    private javax.swing.JLabel jLabel138;
    private javax.swing.JLabel jLabel139;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel140;
    private javax.swing.JLabel jLabel141;
    private javax.swing.JLabel jLabel142;
    private javax.swing.JLabel jLabel143;
    private javax.swing.JLabel jLabel144;
    private javax.swing.JLabel jLabel145;
    private javax.swing.JLabel jLabel146;
    private javax.swing.JLabel jLabel147;
    private javax.swing.JLabel jLabel148;
    private javax.swing.JLabel jLabel149;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel150;
    private javax.swing.JLabel jLabel151;
    private javax.swing.JLabel jLabel152;
    private javax.swing.JLabel jLabel153;
    private javax.swing.JLabel jLabel154;
    private javax.swing.JLabel jLabel155;
    private javax.swing.JLabel jLabel156;
    private javax.swing.JLabel jLabel157;
    private javax.swing.JLabel jLabel158;
    private javax.swing.JLabel jLabel159;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel160;
    private javax.swing.JLabel jLabel161;
    private javax.swing.JLabel jLabel162;
    private javax.swing.JLabel jLabel163;
    private javax.swing.JLabel jLabel164;
    private javax.swing.JLabel jLabel165;
    private javax.swing.JLabel jLabel166;
    private javax.swing.JLabel jLabel167;
    private javax.swing.JLabel jLabel168;
    private javax.swing.JLabel jLabel169;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel170;
    private javax.swing.JLabel jLabel171;
    private javax.swing.JLabel jLabel172;
    private javax.swing.JLabel jLabel173;
    private javax.swing.JLabel jLabel174;
    private javax.swing.JLabel jLabel175;
    private javax.swing.JLabel jLabel176;
    private javax.swing.JLabel jLabel177;
    private javax.swing.JLabel jLabel178;
    private javax.swing.JLabel jLabel179;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel180;
    private javax.swing.JLabel jLabel181;
    private javax.swing.JLabel jLabel182;
    private javax.swing.JLabel jLabel183;
    private javax.swing.JLabel jLabel184;
    private javax.swing.JLabel jLabel185;
    private javax.swing.JLabel jLabel186;
    private javax.swing.JLabel jLabel187;
    private javax.swing.JLabel jLabel188;
    private javax.swing.JLabel jLabel189;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel66;
    private javax.swing.JLabel jLabel67;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel80;
    private javax.swing.JLabel jLabel81;
    private javax.swing.JLabel jLabel82;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JLabel jLabel85;
    private javax.swing.JLabel jLabel86;
    private javax.swing.JLabel jLabel87;
    private javax.swing.JLabel jLabel88;
    private javax.swing.JLabel jLabel89;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabel90;
    private javax.swing.JLabel jLabel91;
    private javax.swing.JLabel jLabel92;
    private javax.swing.JLabel jLabel93;
    private javax.swing.JLabel jLabel94;
    private javax.swing.JLabel jLabel95;
    private javax.swing.JLabel jLabel96;
    private javax.swing.JLabel jLabel97;
    private javax.swing.JLabel jLabel98;
    private javax.swing.JLabel jLabel99;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JSlider jSlider1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    // End of variables declaration//GEN-END:variables
    private JDialog aboutBox;
    private JDialog configuracion;
    private JDialog efectivoDialog;
    private JDialog actualizacionDialog;
    private List<ClienteVO> listaDeClientes;
    private Fecha fahora;
    private Fecha finicio;
    private Fecha ffinal;
    private long maxtiempo = 0;
    private Thread hilotiempo;
    private Thread hiloVentas;
    private Thread hiloArticulos;
    private Thread hiloArticulosHoy;
    private Thread hiloClientes;
    private Thread hiloStock;
    private Thread hiloPedidos;
    private boolean ventas = false;
    private boolean generandoinforme =false;
    private DecimalFormat df;

    //********************Métodos privados***************************************
    private void recargar_Configuracion() {
        initComponents();
        jCalendar1.setDate(new Date());
        jCalendar2.setDate(new Date());
        Ficheros.leer();
        jButton3.setEnabled(Variables.ticket);
        //Inicializacion clientes
        listaDeClientes = UtilidadesBaseDatos.realizarConsultaListaClienteVO();
        for (ClienteVO c : listaDeClientes) {
            jComboBox1.addItem(c);
        }
        hilotiempo = new ThreadTiempo();
        hilotiempo.start();
        jProgressBar1.setVisible(false);
        jLabel174.setVisible(false);
        df = new DecimalFormat();
        df.setMaximumFractionDigits(2);
    }

    private void cdc() throws ParseException {
        ClienteVO c = (ClienteVO) jComboBox1.getSelectedItem();
        iniciar_fechas();

        Fecha fayer = UtilidadesFecha.obtener_dia_anterior(fahora);
        Fecha fmayer = UtilidadesFecha.obtener_mes_anterior(fahora);
        Fecha faayer = UtilidadesFecha.obtener_ano_anterior(fayer);

        String sql = "";
        Float f = null;
        String aux = "";


        // Ventas del cliente 
        // Hoy
        sql = "select count (*) from (Select distinct(Nventa) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0)) and (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + ")+TimeSerial(23,59,59)))";
        jLabel128.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
        // Mes 
        sql = "select count (*) from (Select distinct(Nventa) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + ")+TimeSerial(23,59,59)))";
        jLabel135.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
        // Año
        sql = "select count (*) from (Select distinct(Nventa) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + ",1,1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + ",12,31)+TimeSerial(23,59,59)))";
        jLabel142.setText(UtilidadesBaseDatos.realizarConsultastr(sql));

        // Importe del cliente 
        // Hoy
        sql = "Select sum(Parcial) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0)) and (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + ")+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel129.setText(df.format(f));
        // Mes 
        sql = "Select sum(Parcial) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + ")+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel136.setText(df.format(f));
        // Año
        sql = "Select sum(Parcial) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + ",1,1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + ",12,31)+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel143.setText(df.format(f));

        // Unidades del cliente 
        // Hoy
        sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0)) and (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + ")+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel130.setText(df.format(f));
        // Mes 
        sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + ")+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel137.setText(df.format(f));
        // Año
        sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + ",1,1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + ",12,31)+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel144.setText(df.format(f));

        // Incremento Ventas
        // Seleccion
        // Mes 
        sql = "select count (*) from (Select distinct(Nventa) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fmayer.ano + "," + fmayer.mes + ",1)+TimeSerial(0,0,0)) and (DateSerial(" + fmayer.ano + "," + fmayer.mes + "," + fahora.dia + ")+TimeSerial(23,59,59)))";
        aux = UtilidadesBaseDatos.realizarConsultastr(sql);
        if (aux != null && !aux.isEmpty()) {
            if (!aux.equals("0") && !jLabel135.getText().equals("0")) {
                Double cantidad_ayer = new Double(aux);
                Double cantidadHoy =(df.parse(jLabel135.getText())).doubleValue();
                Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                jLabel138.setText(df.format(resultado));
            } else {
                jLabel138.setText("0");
            }
        }
        // Año
        sql = "select count (*) from (Select distinct(Nventa) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0)) and (DateSerial(" + faayer.ano + "," + fahora.mes + "," + fahora.dia + ")+TimeSerial(23,59,59)))";
        aux = UtilidadesBaseDatos.realizarConsultastr(sql);
        if (aux != null && !aux.isEmpty()) {
            if (!aux.equals("0") && !jLabel142.getText().equals("0")) {
                Double cantidad_ayer = new Double(aux);
                Double cantidadHoy = (df.parse(jLabel142.getText())).doubleValue();
                Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                jLabel145.setText(df.format(resultado));
            } else {
                jLabel145.setText("0");
            }
        }
        // Incremento Importe
        // Seleccion
        // Mes
        sql = "Select sum(Parcial) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fmayer.ano + "," + fmayer.mes + ",1)+TimeSerial(0,0,0)) and (DateSerial(" + fmayer.ano + "," + fmayer.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
        aux = UtilidadesBaseDatos.realizarConsultastr(sql);
        if (aux != null && !aux.isEmpty()) {
            if (!aux.equals("0") && !jLabel136.getText().equals("0")) {
                Double cantidad_ayer = new Double(aux);
                Double cantidadHoy = (df.parse(jLabel136.getText())).doubleValue();
                Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                jLabel139.setText(df.format(resultado));
            } else {
                jLabel139.setText("0");
            }
        }
        // Año
        sql = "Select sum(Parcial) from Ventas where  Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0)) and (DateSerial(" + faayer.ano + "," + fahora.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
        aux = UtilidadesBaseDatos.realizarConsultastr(sql);
        if (aux != null && !aux.isEmpty()) {
            if (!aux.equals("0") && !jLabel143.getText().equals("0")) {
                Double cantidad_ayer = new Double(aux);
                Double cantidadHoy = (df.parse(jLabel143.getText())).doubleValue();
                Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                jLabel146.setText(df.format(resultado));
            } else {
                jLabel146.setText("0");
            }
        }

        // Incremento Unidades
        // Seleeccion
        // Mes
        sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fmayer.ano + "," + fmayer.mes + ",1)+TimeSerial(0,0,0)) and (DateSerial(" + fmayer.ano + "," + fmayer.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
        aux = UtilidadesBaseDatos.realizarConsultastr(sql);
        if (aux != null && !aux.isEmpty()) {
            if (!aux.equals("0") && !jLabel137.getText().equals("0")) {
                Double cantidad_ayer = new Double(aux);
                Double cantidadHoy = (df.parse(jLabel137.getText())).doubleValue();
                Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                jLabel140.setText(df.format(resultado));
            } else {
                jLabel140.setText("0");
            }
        }
        // Año
        sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0)) and (DateSerial(" + faayer.ano + "," + fahora.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
        aux = UtilidadesBaseDatos.realizarConsultastr(sql);
        if (aux != null && !aux.isEmpty()) {
            if (!aux.equals("0") && !jLabel144.getText().equals("0")) {
                Double cantidad_ayer = new Double(aux);
                Double cantidadHoy = (df.parse(jLabel144.getText())).doubleValue();
                Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                jLabel147.setText(df.format(resultado));
            } else {
                jLabel147.setText("0");
            }
        }
        jLabel149.setText(c.fechaCaducidad.getStrFormatoDDMMAAA());
        jLabel151.setText(c.totalCompra.toString());
        jLabel153.setText(c.ultimaCompra.getStrFormatoDDMMAAA());
    }

    private void actualizar_ritmo_ventas() {
        if (ventas) {
            Float f = new Float(jLabel4.getText());
            int nhora = UtilidadesFecha.horadeldiaabierto();
            jLabel155.setText("Ritmo (V x H): " + f / nhora);
        }
    }

    private void informeVentas() {

        String nombreFichero = "Ventas_";
        StringBuffer informeTexto = new StringBuffer();
        String sql = "";
       
        if (fahora == null) {
            fahora = new Fecha();
        }
        Fecha faanterior = UtilidadesFecha.obtener_ano_anterior(fahora);
        informeTexto.append("<html><head><title>Informe " + nombreFichero + "</title></head><body>");
        Float fi = new Float(0);
        Float fa = new Float(0);
        Float resultado = new Float(0);
        informeTexto.append("Importe");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr><th align='center'>Mes</th><th align='center'>Importe " + fahora.ano + "</th><th align='center'>Importe " + faanterior.ano + "</th><th align='center'>Incremento</th><th>Diferencia</th></tr>");
        jLabel174.setText("Importe Ventas");
        jProgressBar1.setValue(0);
        for (int i = 1; i <= fahora.mes; i++) {
            informeTexto.append("<tr><td>");
            // Mes
            informeTexto.append(UtilidadesFecha.obtener_nombre_mes_str(i));
            // Importe de este mes
            sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + fahora.ano + "," + i + ",01)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(fahora.ano,i-1,fahora.dia) +"))+TimeSerial(23,59,59)";
            fi = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("</td><td>" + df.format(fi) + "</td>");
            sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + faanterior.ano + "," + i + ",01)+TimeSerial(0,0,0))  And (DateSerial(" + faanterior.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(faanterior.ano,i-1,faanterior.dia) +"))+TimeSerial(23,59,59)";
            fa = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("<td>" + df.format(fa) + "</td>");
            resultado = -(100 - ((fi * 100) / fa));
            informeTexto.append("<td>" + df.format(resultado) + "</td>");
            resultado = fi-fa;
            informeTexto.append("<td>" +df.format(resultado) +"</td>");
            jProgressBar1.setValue((i*100)/12);
            jProgressBar1.setString(""+jProgressBar1.getValue()+"%");
        }
        informeTexto.append("</table>");

        informeTexto.append("<br>");
        informeTexto.append("Beneficio");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr><th align='center'>Mes</th><th align='center'>Importe " + fahora.ano + "</th><th align='center'>Importe " + faanterior.ano + "</th><th align='center'>Incremento</th></th><th>Diferencia</th></tr></tr>");
        jLabel174.setText("Importe Beneficio");
        jProgressBar1.setValue(0);
        for (int i = 1; i <= fahora.mes; i++) {
            informeTexto.append("<tr><td>");
            // Mes
            informeTexto.append(UtilidadesFecha.obtener_nombre_mes_str(i));
            sql = "select sum(Parcial-Coste) from Ventas where Fecha Between (DateSerial(" + fahora.ano + "," + i + ",01)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(fahora.ano,i-1,fahora.dia) +"))+TimeSerial(23,59,59)";
            fi = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("</td><td>" + df.format(fi) + "</td>");
            sql = "select sum(Parcial-Coste) from Ventas where Fecha Between (DateSerial(" + faanterior.ano + "," + i + ",01)+TimeSerial(0,0,0))  And (DateSerial(" + faanterior.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(faanterior.ano,i-1,faanterior.dia) +"))+TimeSerial(23,59,59)";
            fa = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("<td>" + df.format(fa) + "</td>");
            resultado = -(100 - ((fi * 100) / fa));
            informeTexto.append("<td>" + df.format(resultado) + "</td>");
             resultado = fi-fa;
            informeTexto.append("<td>" +df.format(resultado) +"</td>");
            jProgressBar1.setValue((i*100)/12);
            jProgressBar1.setString(""+jProgressBar1.getValue()+"%");
        }
        informeTexto.append("</table>");

        informeTexto.append("<br>");
        informeTexto.append("Unidades");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr><th align='center'>Mes</th><th align='center'>Importe " + fahora.ano + "</th><th align='center'>Importe " + faanterior.ano + "</th><th align='center'>Incremento</th></th><th>Diferencia</th></tr></tr>");
        jLabel174.setText("Unidades");
        jProgressBar1.setValue(0);
        for (int i = 1; i <= fahora.mes; i++) {
            informeTexto.append("<tr><td>");
            // Mes
            informeTexto.append(UtilidadesFecha.obtener_nombre_mes_str(i));
            sql = "select sum(Cdad) from Ventas where Fecha Between (DateSerial(" + fahora.ano + "," + i + ",01)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(fahora.ano,i-1,fahora.dia) +"))+TimeSerial(23,59,59)";
            fi = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("</td><td>" + df.format(fi) + "</td>");
            sql = "select sum(Cdad) from Ventas where Fecha Between (DateSerial(" + faanterior.ano + "," + i + ",01)+TimeSerial(0,0,0))  And (DateSerial(" + faanterior.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(faanterior.ano,i-1,faanterior.dia) +"))+TimeSerial(23,59,59)";
            fa = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("<td>" + df.format(fa) + "</td>");
            resultado = -(100 - ((fi * 100) / fa));
            informeTexto.append("<td>" + df.format(resultado) + "</td>");
             resultado = fi-fa;
            informeTexto.append("<td>" +df.format(resultado) +"</td>");
            jProgressBar1.setValue((i*100)/12);
            jProgressBar1.setString(""+jProgressBar1.getValue()+"%");
        }
        informeTexto.append("</table></body></html>");
        presentarInforme(Variables.d_informe_ventas+"\\"+ nombreFichero, informeTexto);
    }

    private void informeArticulos() {
        String nombreFichero = "Articulos_";
        StringBuffer informeTexto = new StringBuffer();
        String sql = "";
        DecimalFormat df = new DecimalFormat();
        jProgressBar1.setVisible(true);
        df.setMaximumFractionDigits(2);
        if (fahora == null) {
            fahora = new Fecha();
        }
      
        informeTexto.append("<html><head><title>Informe " + nombreFichero + "</title></head><body>");
        Float resultado = new Float(0);
        informeTexto.append("Resumen anual");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr>");
        informeTexto.append("<th> Marca </th><th>Total</th><th>Total "+fahora.ano+" </th>");
        for (int i=1;i<=12;i++){
            informeTexto.append("<th>"+ UtilidadesFecha.obtener_nombre_mes_str(i)+"</th>");
        }
        informeTexto.append("</tr>");
        List<ArticuloVO> listaDeArticulos;
        sql = "select art,a.Descripción as descri from (select sum(v.Cdad)as cant,v.Artículo as art from Ventas v where Fecha Between (DateSerial(" + fahora.ano + ",01,01)+TimeSerial(0,0,0))And (DateSerial(" + fahora.ano + ","+fahora.mes+","+fahora.dia+")+TimeSerial(23,59,59))group by Artículo ),artículos a where a.Artículo = art and a.FamSub <>'RCMRCM' order by cant desc";
        listaDeArticulos = UtilidadesBaseDatos.obtenerTodosArticuloVO(Variables.rutaBaseDatosTrabajo, sql);
        int poslita = 0;
        int tlista = listaDeArticulos.size();
        for (ArticuloVO a: listaDeArticulos){
            
            poslita++;
            informeTexto.append("<tr>");
            informeTexto.append("<td>"+a.descripcion+"</td>");
            // Total
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + a.codigo + "' ";
            resultado = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));  
            informeTexto.append("<td>"+df.format(resultado) +"</td>");
            // Total año
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + a.codigo + "' and Fecha Between (DateSerial(" + fahora.ano + ",1, 1)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + ",12,31)+TimeSerial(23,59,59))";
            resultado = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));  
            informeTexto.append("<td>"+df.format(resultado) +"</td>");
            
            jLabel174.setText(a.descripcion);
            
            for (int i=1;i<=fahora.mes;i++){
                sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + a.codigo + "' and Fecha Between (DateSerial(" + fahora.ano + "," + i + ", 1)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(fahora.ano,i-1,fahora.dia) +")+TimeSerial(23,59,59))";
                resultado = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));  
                informeTexto.append("<td>"+df.format(resultado) +"</td>");
                
            }
            informeTexto.append("</tr>");
            jProgressBar1.setValue((poslita*100)/tlista);
            jProgressBar1.setString(""+jProgressBar1.getValue()+"%");
        }
      
        informeTexto.append("</table></body></html>"); 
        presentarInforme(Variables.d_informe_articulos+"\\"+ nombreFichero, informeTexto);
    }
    
    
    private void informeArticuloshoy() {
        String nombreFichero = "Articuloshoy_";
        StringBuffer informeTexto = new StringBuffer();
        String sql = "";
        DecimalFormat df = new DecimalFormat();
        jProgressBar1.setVisible(true);
        df.setMaximumFractionDigits(2);
        if (fahora == null) {
            fahora = new Fecha();
        }
      
        informeTexto.append("<html><head><title>Informe " + nombreFichero + "</title></head><body>");
        Float resultado = new Float(0);
        informeTexto.append("Resumen del dia");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr>");
        informeTexto.append("<th> Pos </th><th> Marca </th><th>Total </th>");
        informeTexto.append("</tr>");
        List<ArticuloVO> listaDeArticulos;
        sql = "select art,a.Descripción as descri from (select sum(v.Cdad)as cant,v.Artículo as art from Ventas v where Fecha Between (DateSerial(" + fahora.ano + ","+fahora.mes+","+fahora.dia+")+TimeSerial(0,0,0))And (DateSerial(" + fahora.ano + ","+fahora.mes+","+fahora.dia+")+TimeSerial(23,59,59))group by Artículo ),artículos a where a.Artículo = art and a.FamSub <>'RCMRCM' order by cant desc";
        listaDeArticulos = UtilidadesBaseDatos.obtenerTodosArticuloVO(Variables.rutaBaseDatosTrabajo, sql);
        int poslita = 0;
        int tlista = listaDeArticulos.size();
        for (ArticuloVO a: listaDeArticulos){
            
            poslita++;
            informeTexto.append("<tr>");
            informeTexto.append("<td>"+(poslita)+"</td>");
            
            informeTexto.append("<td>"+a.descripcion+"</td>");
           
            // Total año
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + a.codigo + "' and Fecha Between (DateSerial(" + fahora.ano + ","+fahora.mes+","+fahora.dia+")+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + ","+fahora.mes+","+fahora.dia+")+TimeSerial(23,59,59))";
            resultado = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));  
            informeTexto.append("<td>"+df.format(resultado) +"</td>");
            jLabel174.setText(a.descripcion);       
            informeTexto.append("</tr>");
            jProgressBar1.setValue((poslita*100)/tlista);
            jProgressBar1.setString(""+jProgressBar1.getValue()+"%");
        }
      
        informeTexto.append("</table></body></html>"); 
        presentarInforme(Variables.d_informe_articuloshoy+"\\"+ nombreFichero, informeTexto);
    }

    private void informeClientes() {
        String nombreFichero = "Clientes";
        StringBuffer informeTexto = new StringBuffer();
        String sql = "";
        DecimalFormat df = new DecimalFormat();
        
        jProgressBar1.setVisible(true);
        df.setMaximumFractionDigits(2);
        if (fahora == null) {
            fahora = new Fecha();
        }
        Fecha faanterior = UtilidadesFecha.obtener_ano_anterior(fahora);
        informeTexto.append("<html><head><title>Informe " + nombreFichero + "</title></head><body>");
        Float fi = new Float(0);
        Float fa = new Float(0);
        Float resultado = new Float(0);
        informeTexto.append("Resumen anual");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr>");
        informeTexto.append("<th>Cliente</th><th>Total</th><th>Total Ano</th>");
        for (int i=1;i<=12;i++){
            informeTexto.append("<th>"+ UtilidadesFecha.obtener_nombre_mes_str(i)+"</th>");
        }
        informeTexto.append("</tr>");
        int poslita=0;
        int tlista = listaDeClientes.size();
        for (ClienteVO c:listaDeClientes){
            poslita++;
            informeTexto.append("<tr>");
            informeTexto.append("<td>"+c.identificador+"</td>");
            sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente+"'" ;
            resultado = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("<td>"+df.format(resultado) +"</td>");
            sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + ",1,1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + ",12,31)+TimeSerial(23,59,59))";
            resultado = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            informeTexto.append("<td>"+df.format(resultado) +"</td>");
            jLabel174.setText("Cliente: "+c.identificador);
            for (int i=1;i<=fahora.mes;i++){
                // Año en curso
                sql = "Select sum(Cdad) from Ventas where Cliente='" + c.codigoCliente + "' and Fecha Between (DateSerial(" + fahora.ano + ","+i+",1)+TimeSerial(0,0,0)) and (DateSerial(" + fahora.ano + "," + i + ","+UtilidadesFecha.obtener_ultimo_mes(fahora.ano,i-1,fahora.dia) +")+TimeSerial(23,59,59))";
                resultado = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
                informeTexto.append("<td>"+df.format(resultado) +"</td>");
            }
            informeTexto.append("</tr>");
            jProgressBar1.setValue((poslita*100)/tlista);
            jProgressBar1.setString(""+jProgressBar1.getValue()+"%");
        }
        
        
        informeTexto.append("</table></body></html>"); 
        presentarInforme(Variables.d_informe_clientes+"\\"+ nombreFichero, informeTexto);
    }

    
    private void informeStock(){
        String nombreFichero = "Stock";
        StringBuffer informeTexto = new StringBuffer();
        String sql = "";
        DecimalFormat df = new DecimalFormat();
        
        jProgressBar1.setVisible(true);
        df.setMaximumFractionDigits(2);
        
        sql = "Select Codprov,Descripción,Stock1 from artículos where Stock2>0 order by Stock1 desc";
        List<ArticuloVO> listaDeArticulos = UtilidadesBaseDatos.realizarConsultaListaStockArticuloVO(sql);
        
        informeTexto.append("<html><head><title>Informe " + nombreFichero + "</title></head><body>");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr>");
        informeTexto.append("<th>Codigo SAP</th><th>Descripcion</th><th>Stock</th>");
        informeTexto.append("</tr>");
        for (ArticuloVO a:listaDeArticulos){
            informeTexto.append("<tr><td>"+a.codigo+"</td><td>"+a.descripcion+"</td><td>"+df.format(a.stock)+"</td></tr>");
        }
        informeTexto.append("</table></body></html>"); 
        presentarInforme(Variables.d_stock+"\\"+ nombreFichero, informeTexto);
    }
    
    
     private void informePedido(){
        String nombreFichero = "Pedido";
        StringBuffer informeTexto = new StringBuffer();
        DecimalFormat df = new DecimalFormat();
        
        jProgressBar1.setVisible(true);
        df.setMaximumFractionDigits(2);
        
        List<PedidoVO> listaPedido = UtilidadesBaseDatos.obtenerTodosArticulosPedidoVO();
        
        informeTexto.append("<html><head><title>Informe " + nombreFichero + "</title></head><body>");
        informeTexto.append("<table border='1'>");
        informeTexto.append("<tr>");
        informeTexto.append("<th>Codigo SAP</th><th>Descripcion</th><th>Stock</th><th>Media Mes</th><th>Pedir</th>");
        informeTexto.append("</tr>");
        for (PedidoVO p:listaPedido){
            informeTexto.append("<tr><td>"+p.getCodigo()+"</td><td>"+p.getDescripcion()+"</td><td>"+df.format(p.getStock())+"</td><td>"+df.format(p.getMediames())+"</td><td>"+p.getPedir()+"</td></tr>");
        }
        informeTexto.append("</table></body></html>"); 
        presentarInforme(Variables.d_pedidos+"\\"+ nombreFichero, informeTexto);
    }  
   
    
    private void presentarInforme(String nombreFichero, StringBuffer informeTexto) {
        Fecha f = new Fecha();
        try {
            Ficheros.escribir_fichero_texto(nombreFichero + f.getStrFechaFormatoAmericano() + ".htm", informeTexto);
            Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + nombreFichero + f.getStrFechaFormatoAmericano() + ".htm");
        } catch (IOException ex) {
            Logger.getLogger(VentasDiaView.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void calcularVentas() {
        String sql = "";
        Float f;
        Float f2;
        Integer i;
        ventas = true;
        // Dia
        // Total número de ventas                
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(23,59,59))";
        jLabel4.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
        // Total importe
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(23,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel6.setText(f.toString());
        // Total Beneficio
        sql = "select sum(Parcial-Coste) from Ventas where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel8.setText(f.toString());
        // Total Cantidad
        sql = "select sum(Cdad) from Ventas where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel10.setText(f.toString());
        // Total Recargas
        sql = "select sum(Parcial) from Ventas where FamSub = 'RCMRCM' and Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel31.setText(f.toString());
        // Mes
        //Ventas
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia + "))+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel12.setText(f.toString());
        //Importe
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia + "))+TimeSerial(23,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel14.setText(f.toString());
        //Beneficio
        sql = "select sum(Parcial-Coste) from Ventas where Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + "))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel16.setText(f.toString());
        // Cantidad
        sql = "select sum(Cdad) from Ventas where Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + "))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel18.setText(f.toString());
        // Total Recargas
        sql = "select sum(Parcial) from Ventas where FamSub = 'RCMRCM' and Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + "))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel33.setText(f.toString());
        // Año
        // ventas                
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + ",01,01)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + ",12,31))+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel26.setText(f.toString());
        // importe 
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + fahora.ano + ",01,01)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + ",12,31))+TimeSerial(23,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel24.setText(f.toString());
        // Beneficio
        sql = "select sum(Parcial-Coste) from Ventas where Fecha Between (DateSerial(" + fahora.ano + ",01,01)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + ",12,31))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel20.setText(f.toString());
        // Total Cantidad
        sql = "select sum(Cdad) from Ventas where Fecha Between (DateSerial(" + fahora.ano + ",01,01)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + ",12,31))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel21.setText(f.toString());
        // Total Recargas
        sql = "select sum(Parcial) from Ventas where FamSub = 'RCMRCM' and Fecha Between (DateSerial(" + fahora.ano + ",01,01)+TimeSerial(0,0,0))  And (DateSerial(" + fahora.ano + ",12,31))+TimeSerial(23,59,59)";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel35.setText(f.toString());

        // Media Mes
        // Media ventas mes
        f = new Float(jLabel12.getText());
        f = f / fahora.dia;
        jLabel43.setText(f.toString());
        // Media importe mes
        f = new Float(jLabel14.getText());
        f = f / fahora.dia;
        jLabel37.setText(f.toString());
        // Media beneficio mes
        f = new Float(jLabel16.getText());
        f = f / fahora.dia;
        jLabel39.setText(f.toString());
        // Media cantidad mes
        f = new Float(jLabel18.getText());
        f = f / fahora.dia;
        jLabel41.setText(f.toString());
        // Año
        // Media ventas 
        f = new Float(jLabel26.getText());
        f = f / fahora.dia_ano;
        jLabel50.setText(f.toString());
        // Media Importe 
        f = new Float(jLabel24.getText());
        f = f / fahora.dia_ano;
        jLabel46.setText(f.toString());
        // Media beneficio
        f = new Float(jLabel20.getText());
        f = f / fahora.dia_ano;
        jLabel48.setText(f.toString());
        // Media unidades
        f = new Float(jLabel21.getText());
        f = f / fahora.dia_ano;
        jLabel44.setText(f.toString());

        // Importe por venta
        // Unidades por venta
        // Dia
        i = new Integer(jLabel4.getText());
        f = new Float(jLabel6.getText());
        f = f / i;
        jLabel158.setText(f.toString());
        f = new Float(jLabel10.getText());
        f = f / i;
        jLabel159.setText(f.toString());
        // Mes
        f2 = new Float(jLabel12.getText());
        f = new Float(jLabel14.getText());
        f = f / f2;
        jLabel160.setText(f.toString());
        f = new Float(jLabel18.getText());
        f = f / f2;
        jLabel161.setText(f.toString());
        // Año
        f2 = new Float(jLabel26.getText());
        f = new Float(jLabel24.getText());
        f = f / f2;
        jLabel162.setText(f.toString());
        f = new Float(jLabel21.getText());
        f = f / f2;
        jLabel163.setText(f.toString());
    }

    private void calcularPrevision() {
        Integer i;
        Float f;
        Float cantidadAyer;
        String sql="";
        Fecha fmesayer = new Fecha();
        Fecha faayer = new Fecha();
                
        fmesayer = UtilidadesFecha.obtener_mes_anterior(fmesayer);
        faayer = UtilidadesFecha.obtener_ano_anterior(faayer);
        int nhora = UtilidadesFecha.horadeldiaabierto();
        // Hoy
        // Prevision ventas
        i = new Integer(jLabel4.getText());
        i = (i / nhora) * Variables.HORAS_ABIERTO;
        jLabel53.setText(i.toString());
        // Prevision importe
        f = new Float(jLabel6.getText());
        f = (f / nhora) * Variables.HORAS_ABIERTO;
        jLabel54.setText(f.toString());
        // Prevision Beneficio
        f = new Float(jLabel8.getText());
        f = (f / nhora) * Variables.HORAS_ABIERTO;
        jLabel55.setText(f.toString());
        // Prevision Cantidad
        f = new Float(jLabel10.getText());
        f = (f / nhora) * Variables.HORAS_ABIERTO;
        jLabel56.setText(f.toString());
        //Mes
        // Venas
        f = new Float(jLabel43.getText());
        f = f * fahora.dia_fin;
        jLabel57.setText(f.toString());
        // Importe
        f = new Float(jLabel37.getText());
        f = f * fahora.dia_fin;
        jLabel58.setText(f.toString());
        // Beneficio
        f = new Float(jLabel39.getText());
        f = f * fahora.dia_fin;
        jLabel59.setText(f.toString());
        // Unidades
        f = new Float(jLabel41.getText());
        f = f * fahora.dia_fin;
        jLabel60.setText(f.toString());
        // Año
        // Ventas
        f = new Float(jLabel50.getText());
        f = f * 365;
        jLabel62.setText(f.toString());
        // Importe
        f = new Float(jLabel46.getText());
        f = f * 365;
        jLabel63.setText(f.toString());
        // Beneficio
        f = new Float(jLabel48.getText());
        f = f * 365;
        jLabel64.setText(f.toString());
        //Unidades
        f = new Float(jLabel44.getText());
        f = f * 365;
        jLabel65.setText(f.toString());
        
        // Porcentaje mes anterior
        // -(100 - ((cantidadHoy * 100) / cantidad_ayer));
        f = new Float(jLabel12.getText());
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + ",1)+TimeSerial(0,0,0)) And  (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + "," + fmesayer.dia + "))+TimeSerial(23,59,59))";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;
        jLabel165.setText(f.toString());
        f = new Float (jLabel14.getText());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + ",1)+TimeSerial(0,0,0))  And (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + "," + fmesayer.dia + "))+TimeSerial(23,59,59) ";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;
        jLabel166.setText(f.toString());
        f = new Float (jLabel16.getText());
        sql = "select sum(Parcial-Coste) from Ventas where Fecha Between (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + ",1)+TimeSerial(0,0,0))  And (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + "," + fmesayer.dia + "))+TimeSerial(23,59,59)";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;
        jLabel167.setText(f.toString());
        f = new Float (jLabel18.getText());        
        sql = "select sum(Cdad) from Ventas where Fecha Between (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + ",1)+TimeSerial(0,0,0))  And (DateSerial(" + fmesayer.ano + "," + fmesayer.mes + "," + fmesayer.dia + "))+TimeSerial(23,59,59)";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;        
        jLabel168.setText(f.toString());
        // Porcentaje año anterior
        f = new Float(jLabel26.getText());
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0)) And  (DateSerial(" + faayer.ano + "," + faayer.mes + "," + faayer.dia + "))+TimeSerial(23,59,59))";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;
        jLabel170.setText(f.toString());
        f = new Float (jLabel24.getText());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0))  And (DateSerial(" + faayer.ano + "," + faayer.mes + "," + faayer.dia + "))+TimeSerial(23,59,59) ";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;
        jLabel171.setText(f.toString());
        f = new Float (jLabel20.getText());
        sql = "select sum(Parcial-Coste) from Ventas where Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0))  And (DateSerial(" + faayer.ano + "," + faayer.mes + "," + faayer.dia + "))+TimeSerial(23,59,59)";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;
        jLabel172.setText(f.toString());
        f = new Float (jLabel21.getText());        
        sql = "select sum(Cdad) from Ventas where Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0))  And (DateSerial(" + faayer.ano + "," + faayer.mes + "," + faayer.dia + "))+TimeSerial(23,59,59)";
        cantidadAyer = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        f = f - cantidadAyer;        

        jLabel173.setText(f.toString());
        
    }

    private void calcularArticulos() {
        iniciar_fechas();
        Fecha fayer = UtilidadesFecha.obtener_dia_anterior(fahora);
        Fecha fmayer = UtilidadesFecha.obtener_mes_anterior(fahora);
        Fecha faayer = UtilidadesFecha.obtener_ano_anterior(fayer);
        Float f;
        String cod_bus = jTextField1.getText();
        String sql = "";

        if (cod_bus != null && !cod_bus.isEmpty()) {
            sql = "Select distinct(a.Artículo) from artículos a left join asignaciones n on a.Artículo = n.Artículo where a.Código2='" + cod_bus + "' or a.Codprov = '" + cod_bus + "' or a.Artículo = '" + cod_bus + "' or n.Codasig ='" + cod_bus + "'";
            cod_bus = UtilidadesBaseDatos.realizarConsultastr(sql);
            //Nombre articulo
            sql = "Select a.Descripción from artículos a where a.Artículo ='" + cod_bus + "'";
            jLabel117.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
            // Fecha útlima venta
            sql = "Select top 1 Fecha from Ventas where Artículo = '" + cod_bus + "' order by Fecha desc";
            jLabel119.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
            // Seleccion
            // Unidades 
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + ")+TimeSerial(23,59,59))";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            jLabel51.setText(f.toString());
            // Euros
            sql = "Select sum(v.Parcial) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(0,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + ")+TimeSerial(23,59,59))";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            jLabel61.setText(f.toString());
            // Incremento U
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fayer.ano + "," + fayer.mes + "," + fayer.dia + ")+TimeSerial(0,0,0)) And  (DateSerial(" + fayer.ano + "," + fayer.mes + "," + fayer.dia + ")+TimeSerial(23,59,59))";
            String aux = UtilidadesBaseDatos.realizarConsultastr(sql);
            if (aux != null && !aux.isEmpty()) {
                if (!aux.equals("0") && !jLabel51.getText().equals("0")) {
                    Double cantidad_ayer = new Double(aux);
                    Double cantidadHoy = new Double(jLabel51.getText());
                    Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                    jLabel66.setText(resultado.toString());
                } else {
                    jLabel66.setText("0");
                }
            }
            // Incremento E
            sql = "Select sum(v.Parcial) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fayer.ano + "," + fayer.mes + "," + fayer.dia + ")+TimeSerial(0,0,0)) And  (DateSerial(" + fayer.ano + "," + fayer.mes + "," + fayer.dia + ")+TimeSerial(23,59,59))";
            aux = UtilidadesBaseDatos.realizarConsultastr(sql);
            if (aux != null && !aux.isEmpty()) {
                if (!aux.equals("0") && !jLabel61.getText().equals("0")) {
                    Double cantidad_ayer = new Double(aux);
                    Double cantidadHoy = new Double(jLabel61.getText());
                    Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                    jLabel67.setText(resultado.toString());
                } else {
                    jLabel67.setText("Sin datos");
                }
            }
            // Media U
            f = new Float(jLabel51.getText());
            f = f / UtilidadesFecha.numeroDiasEntreFechas_nozero(finicio, ffinal);
            jLabel68.setText(f.toString());
            // Media E
            f = new Float(jLabel61.getText());
            f = f / UtilidadesFecha.numeroDiasEntreFechas_nozero(finicio, ffinal);
            jLabel69.setText(f.toString());
            //------------
            // Mes
            // Unidades 
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + ")+TimeSerial(23,59,59))";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            jLabel70.setText(f.toString());
            // Euros
            sql = "Select sum(v.Parcial) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fahora.ano + "," + fahora.mes + ",1)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + "," + fahora.mes + "," + fahora.dia_fin + ")+TimeSerial(23,59,59))";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            jLabel71.setText(f.toString());
            // Incremento U
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fmayer.ano + "," + fmayer.mes + ",1)+TimeSerial(0,0,0)) And  (DateSerial(" + fmayer.ano + "," + fmayer.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
            aux = UtilidadesBaseDatos.realizarConsultastr(sql);
            if (aux != null && !aux.isEmpty()) {
                if (!aux.equals("0") && !jLabel70.getText().equals("0")) {
                    Double cantidad_ayer = new Double(aux);
                    Double cantidadHoy = new Double(jLabel70.getText());
                    Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                    jLabel72.setText(resultado.toString());
                } else {
                    jLabel72.setText("Sin datos");
                }
            }
            // Incremento E
            sql = "Select sum(v.Parcial) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fmayer.ano + "," + fmayer.mes + ",1)+TimeSerial(0,0,0)) And  (DateSerial(" + fmayer.ano + "," + fmayer.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
            aux = UtilidadesBaseDatos.realizarConsultastr(sql);
            if (aux != null && !aux.isEmpty()) {
                if (!aux.equals("0") && !jLabel71.getText().equals("0")) {
                    Double cantidad_ayer = new Double(aux);
                    Double cantidadHoy = new Double(jLabel71.getText());
                    Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                    jLabel73.setText(resultado.toString());
                } else {
                    jLabel73.setText("Sin datos");
                }
            }
            // Media U
            f = new Float(jLabel70.getText());
            f = f / fahora.dia;
            jLabel74.setText(f.toString());

            // Media E
            f = new Float(jLabel71.getText());
            f = f / fahora.dia;
            jLabel75.setText(f.toString());
            //------------
            // Año
            // Unidades 
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fahora.ano + ",1,1)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + ",12,31)+TimeSerial(23,59,59))";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            jLabel76.setText(f.toString());
            // Euros
            sql = "Select sum(v.Parcial) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + fahora.ano + ",1,1)+TimeSerial(0,0,0)) And  (DateSerial(" + fahora.ano + ",12,31)+TimeSerial(23,59,59))";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            jLabel77.setText(f.toString());
            // Incremento U
            sql = "Select sum(v.Cdad) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0)) And  (DateSerial(" + faayer.ano + "," + fahora.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
            aux = UtilidadesBaseDatos.realizarConsultastr(sql);
            if (aux != null && !aux.isEmpty()) {
                if (!aux.equals("0") && !jLabel76.getText().equals("0")) {
                    Double cantidad_ayer = new Double(aux);
                    Double cantidadHoy = new Double(jLabel76.getText());
                    Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                    jLabel78.setText(resultado.toString());
                } else {
                    jLabel78.setText("Sin datos");
                }
            }
            // Incremento E
            sql = "Select sum(v.Parcial) from Ventas v where v.Artículo = '" + cod_bus + "' and Fecha Between (DateSerial(" + faayer.ano + ",1,1)+TimeSerial(0,0,0)) And  (DateSerial(" + faayer.ano + "," + fahora.mes + "," + fahora.dia + ")+TimeSerial(23,59,59))";
            aux = UtilidadesBaseDatos.realizarConsultastr(sql);
            if (aux != null && !aux.isEmpty()) {
                if (!aux.equals("0") && !jLabel77.getText().equals("0")) {
                    Double cantidad_ayer = new Double(aux);
                    Double cantidadHoy = new Double(jLabel77.getText());
                    Double resultado = -(100 - ((cantidadHoy * 100) / cantidad_ayer));
                    jLabel79.setText(resultado.toString());
                } else {
                    jLabel79.setText("Sin datos");
                }
            }
            // Media U
            f = new Float(jLabel76.getText());
            f = f / fahora.dia_ano;
            jLabel80.setText(f.toString());
            // Media E
            f = new Float(jLabel77.getText());
            f = f / fahora.dia_ano;
            jLabel81.setText(f.toString());
            //------------
        } else {
            jLabel117.setText("Articulo no encontrado");
        }

    }

    private void calcularHoras() {

        String sql = "";
        Float f = null;

        //10-1
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(5,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(09,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel84.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(05,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(09,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel85.setText(f.toString());
        //9-10
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(10,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(10,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel94.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(10,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(10,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel95.setText(f.toString());
        //11-12
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(11,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(11,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel100.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(11,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(11,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel101.setText(f.toString());
        //12-13
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(12,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(12,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel106.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(12,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(12,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel107.setText(f.toString());
        //13-14
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(13,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(14,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel112.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(13,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(14,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel113.setText(f.toString());
        //17-18
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(16,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(17,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel89.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(16,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(17,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel90.setText(f.toString());
        //18-19
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(18,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(18,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel97.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(18,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(18,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel98.setText(f.toString());
        //19-20
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(19,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(19,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel103.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(19,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(19,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel104.setText(f.toString());
        //20-21
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(20,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(20,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel109.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(20,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(20,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel110.setText(f.toString());
        //21-22
        sql = "Select count (*) from( Select Distinct (Nventa)as ventas from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(21,0,0)) And  (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(23,59,59))";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel115.setText(f.toString());
        sql = "select sum (Parcial) from Ventas  where Fecha Between (DateSerial(" + finicio.ano + "," + finicio.mes + "," + finicio.dia + ")+TimeSerial(21,0,0))  And (DateSerial(" + ffinal.ano + "," + ffinal.mes + "," + ffinal.dia + "))+TimeSerial(23,59,59) ";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel116.setText(f.toString());
    }

    private void iniciar_fechas() {
        fahora = new Fecha();
        finicio = new Fecha(jCalendar1.getDate());
        ffinal = new Fecha(jCalendar2.getDate());
    }

    private void crear_estructura_directorios() {
        Fecha f = new Fecha();
        String ruta_directorio =".\\Actualizacion\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_actualizacion = ruta_directorio;
        File carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
        ruta_directorio = ".\\Actualizacion\\Resultados\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_actualizacion_resultado = ruta_directorio;
        carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
        // Informes
        ruta_directorio = ".\\Informes\\Articulos\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_informe_articulos = ruta_directorio;
        carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
        ruta_directorio = ".\\Informes\\Articuloshoy\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_informe_articuloshoy = ruta_directorio;
        carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
        ruta_directorio = ".\\Informes\\Ventas\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_informe_ventas = ruta_directorio;
        carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
        ruta_directorio = ".\\Informes\\Clientes\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_informe_clientes = ruta_directorio;
        carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
        ruta_directorio =".\\Informes\\Stock\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_stock = ruta_directorio;
        carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
        ruta_directorio =".\\Informes\\Pedidos\\"+f.ano+"\\"+UtilidadesFecha.obtener_nombre_mes_str(f.mes);
        Variables.d_pedidos = ruta_directorio;
        carpeta = new File(ruta_directorio);
        carpeta.mkdirs();
    }

    private void actualizar_mensajes_agenda() {
        
        String sql = "Select top 1 Cita from Agenda where Fecha > Date() order by Fecha asc";
        jLabel174.setVisible(true);
        jLabel174.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
    }

    private void calcularStock() {
        
        Float f;
        
        String sql;
        String cod_bus = "";
        if (jTextField2.getText()!=null && !jTextField2.getText().isEmpty()){
         cod_bus = jTextField2.getText();
        }
        sql = "Select distinct(a.Artículo) from artículos a left join asignaciones n on a.Artículo = n.Artículo where a.Código2='" + cod_bus + "' or a.Codprov = '" + cod_bus + "' or a.Artículo = '" + cod_bus + "' or n.Codasig ='" + cod_bus + "'";
        cod_bus = UtilidadesBaseDatos.realizarConsultastr(sql);
        // total stock
        sql = "select sum(Stock1) as valor from artículos";
        f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel185.setText(df.format(f));
        // valor todo stock
        sql = "select sum(Stock1*Pvp1) as valor from artículos";
        f=new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
        jLabel187.setText(df.format(f));
        
        if(cod_bus!=null && !cod_bus.isEmpty()){
            //Nombre articulo
            sql = "Select a.Descripción from artículos a where a.Artículo ='" + cod_bus + "'";
            jLabel179.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
            // Codigo sap articulo
            sql = "select Codprov from artículos where Artículo ='"+cod_bus+"'";
            jLabel181.setText(UtilidadesBaseDatos.realizarConsultastr(sql));
            // Stock articulo
            sql = "select Stock1 from artículos where Artículo='"+cod_bus+"'";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
            jLabel183.setText(df.format(f));
            // Valor del stock
            sql = "select (Pvp1*Stock1) as valor from artículos where Artículo='"+cod_bus+"'";
            f = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));  
            jLabel189.setText(df.format(f));
        }
    }

    private void gestionarEventos(java.awt.event.KeyEvent evt) {
        int pestana = jTabbedPane1.getSelectedIndex();
        int k = evt.getKeyCode();
        if (k == 10) {
            if (pestana == 2){
                calcularArticulos();
            }
            if (pestana == 3){
                calcularStock();
                jTextField3.requestFocus();
                jTextField3.setText("");
            }
        }
        if (k == 127) {
            jTextField1.setText("");
            jTextField2.setText("");
        }
    }

    //*********************Procesos*******************************************************
    public class ThreadTiempo extends Thread {

        public void run() {
            String sql = "";
            Fecha fe;
            Fecha faux;
            Date aux2;
            while (true) {
                try {
                    //jLabel174.setVisible(false);
                    Thread.sleep(1000*jSlider1.getValue());
                                        
                    while (generandoinforme){
                        Thread.sleep(1000); 
                    }
                    
                    faux = new Fecha();
                    // para temporizador desde las 14 hasta las 5 de la tarde
                    if (faux.hora > 14 && faux.hora < 17) {
                        Thread.sleep(1000 * 60 * 3);
                    }
                    // para el temporizador desde las 10 de la noche a las 9 de la mañana
                    if (faux.hora > 22) {
                        Thread.sleep(1000 * 60 * 11);
                    }
                    aux2 = faux.date;
                    sql = "Select top 1 Fecha from Ventas order by Fecha desc";
                    Date aux = UtilidadesBaseDatos.realizarConsultadate(sql);
                    long tiempo = aux2.getTime() - aux.getTime();
                    fe = UtilidadesFecha.obtener_fecha_long(tiempo);
                    jLabel82.setText("Tiempo desde última venta:   " + fe.hora + ":" + fe.minutos + ":" + fe.segundos);
                    if (tiempo > maxtiempo && fe.hora < 1) {
                        maxtiempo = tiempo;
                    }
                    fe = UtilidadesFecha.obtener_fecha_long(maxtiempo);
                    jLabel154.setText("Máximo tiempo:   " + fe.hora + ":" + fe.minutos + ":" + fe.segundos);
                } catch (InterruptedException ex) {
                    Logger.getLogger(VentasDiaView.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
        
    }// Fin thred tiempo
    
       public class ThreadInformeVentas extends Thread {

        public void run() {
            generandoinforme = true;
            jButton7.setEnabled(false);
            jProgressBar1.setVisible(true);
            jLabel174.setVisible(true);
            informeVentas();
            jLabel174.setVisible(false);
            jButton7.setEnabled(true);
            jProgressBar1.setVisible(false);
            generandoinforme=false;
        }
      }// Fin informe Ventas
    
       
       public class ThreadInformeArticulos extends Thread {

        public void run() {
            generandoinforme=true;
            jButton7.setEnabled(false);
            jProgressBar1.setVisible(true);
            jLabel174.setVisible(true);
            informeArticulos();
            jLabel174.setVisible(false);
            jButton7.setEnabled(true);
            jProgressBar1.setVisible(false);
            generandoinforme=false;
        }
      }// Fin informe Articulos
       
       public class ThreadInformeArticulosHoy extends Thread {

        public void run() {
            generandoinforme=true;
            jButton7.setEnabled(false);
            jProgressBar1.setVisible(true);
            jLabel174.setVisible(true);
            informeArticuloshoy();
            jLabel174.setVisible(false);
            jButton7.setEnabled(true);
            jProgressBar1.setVisible(false);
            generandoinforme=false;
        }
      }// Fin informe Articulos 
       
       
       
       public class ThreadInformeClientes extends Thread {

        public void run() {
            generandoinforme = true;
            jButton7.setEnabled(false);
            jProgressBar1.setVisible(true);
            jLabel174.setVisible(true);
            informeClientes();
            jLabel174.setVisible(false);
            jButton7.setEnabled(true);
            jProgressBar1.setVisible(false);
            generandoinforme=false;
        }
      }// Fin informe Clientes
       
    public class ThreadInformeStock extends Thread {

        public void run() {
            generandoinforme = true;
            jButton7.setEnabled(false);
            jProgressBar1.setVisible(true);
            jLabel174.setVisible(true);
            informeStock();
            jLabel174.setVisible(false);
            jButton7.setEnabled(true);
            jProgressBar1.setVisible(false);
            generandoinforme=false;
        }
      }// Fin informe Clientes
       
    public class ThreadInformePedido extends Thread {

        public void run() {
            generandoinforme = true;
            jButton7.setEnabled(false);
            jProgressBar1.setVisible(true);
            jLabel174.setVisible(true);
            informePedido();
            jLabel174.setVisible(false);
            jButton7.setEnabled(true);
            jProgressBar1.setVisible(false);
            generandoinforme=false;
        }
      }// Fin informe Clientes   
    
    
    
    @Action
    public void guardarStock() {
     
        String codigo = "";
        String sql = "";
        Float cantidad = new Float(0);
        boolean ok = true;
        if (jLabel181.getText()!=null && !jLabel181.getText().isEmpty()){
            codigo = jLabel181.getText();
        }
        else{
            ok = false;
        }
        // 1 establecer
        if (jTextField3.getText()!=null && !jTextField3.getText().isEmpty()){
            Float faux = new Float (jTextField3.getText());
            if (jComboBox2.getSelectedIndex() == 1){
                cantidad = faux;
            }
            else {
                sql = "select Stock1 from artículos where Codprov='"+codigo+"'";
                cantidad = new Float(UtilidadesBaseDatos.realizarConsultastr(sql));
                
                // 2 añadir
                if (jComboBox2.getSelectedIndex() ==2){
                    
                    cantidad = cantidad + faux;
                }
                // 3 retirar
                if (jComboBox2.getSelectedIndex() ==3){
                    cantidad = cantidad - faux;
                    if (cantidad <0){
                        cantidad = 0f;
                    }
                }
            }
        }
        else{
                ok = false;
            }
        
        
        if (ok){
            sql = "update artículos set Stock1="+cantidad+", Stock2=1 where Codprov = '"+codigo+"'" ;
            UtilidadesBaseDatos.actualizar(sql);
            calcularStock();
        }
        else{
            if (codigo!=null && !codigo.isEmpty()){
            sql = "update artículos set Stock2=0 where Codprov = '"+codigo+"'" ;
            UtilidadesBaseDatos.actualizar(sql);
            }
        }        
    }
}
